Skip to content

JsonIgnoreCondition controls are extended - #69574

Closed
onurkanbakirci wants to merge 0 commit into
dotnet:mainfrom
onurkanbakirci:json-ignore-condition
Closed

onurkanbakirci wants to merge 0 commit into
dotnet:mainfrom
onurkanbakirci:json-ignore-condition

Conversation

@onurkanbakirci

@onurkanbakirci onurkanbakirci commented May 19, 2022 •

Copy link
Copy Markdown

Related #66490. @layomia @eiriktsarpalis

JsonIgnoreCondition controls are extended. WhenReading and WhenWriting options are added to JsonIgnoreCondition enum. Tests are passed but i also want to add ClassWithProperty_IgnoreConditionWhenReading_Ctor test case which fails for now. Is there any idea about why ClassWithProperty_IgnoreConditionWhenReading_Ctor test case fails? It's like below:

private class ClassWithProperty_IgnoreConditionWhenReading_Ctor
{
      public string MyString { get; set; }
      [JsonIgnore(Condition = JsonIgnoreCondition.WhenReading)]
      public DateTime MyDateTime { get; }
      public int MyInt { get; }

     public ClassWithProperty_IgnoreConditionWhenReading_Ctor(DateTime myDateTime, int myInt)
     {
         MyDateTime = myDateTime;
        MyInt = myInt;
    }
}

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label May 19, 2022
@ghost

ghost commented May 19, 2022

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost

ghost commented May 19, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

Related #66490. @layomia @eiriktsarpalis

JsonIgnoreCondition controls extended. WhenReading and WhenWriting options added to JsonIgnoreCondition enum. Tests are passed but i also want to add ClassWithProperty_IgnoreConditionWhenReading_Ctor test case which fails for now. Is there any idea about why ClassWithProperty_IgnoreConditionWhenReading_Ctor test case fails?

private class ClassWithProperty_IgnoreConditionWhenReading_Ctor
{
      public string MyString { get; set; }
      [JsonIgnore(Condition = JsonIgnoreCondition.WhenReading)]
      public DateTime MyDateTime { get; }
      public int MyInt { get; }

     public ClassWithProperty_IgnoreConditionWhenReading_Ctor(DateTime myDateTime, int myInt)
     {
         MyDateTime = myDateTime;
        MyInt = myInt;
    }
}
Author: onurkanbakirci
Assignees: -
Labels:

area-System.Text.Json, new-api-needs-documentation, community-contribution

Milestone: -

@onurkanbakirci onurkanbakirci changed the title JsonIgnoreCondition controls extended JsonIgnoreCondition controls extended May 19, 2022
@onurkanbakirci onurkanbakirci changed the title JsonIgnoreCondition controls extended JsonIgnoreCondition controls are extended May 19, 2022
@eiriktsarpalis

Copy link
Copy Markdown
Member

Hi @onurkanbakirci, and thanks for submitting this PR. Unfortunately, we cannot accept contributions introducing new public APIs unless their shape has been previously approved in our API review process. I would recommend holding off until #66490 has been marked with the api-approved label.

I'm going to close this PR for now, but we can always revisit once a decision has been made in API review. In the meantime, please contribute to the conversation in the parent issue, including perhaps upvoting the issue (the more an issue is upvoted, the more likely it is it will get prioritized for a future release). Thanks!

@onurkanbakirci

Copy link
Copy Markdown
Author

Hi @eiriktsarpalis , thanks for your reply.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2022
@dotnet dotnet unlocked this conversation Sep 20, 2023
@eiriktsarpalis

Copy link
Copy Markdown
Member

HI @onurkanbakirci I've reopened your PR given that the API has now been approved. Would it be possible to rebase your changes?

@onurkanbakirci

onurkanbakirci commented Sep 21, 2023 •

Copy link
Copy Markdown
Author

Hi @eiriktsarpalis and @WeihanLi , after reviewing the code again, I noticed that some properties and functions have changed (As you may recall, I opened the PR four months ago, and there have been changes over time in the dotnet/main repository). I am currently working on it, and I will share the fully implemented version with a new PR as soon as possible.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Text.Json community-contribution Indicates that the PR has been added by a community member new-api-needs-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants