Skip to content

Prevent runtime prop metadata retrieval when [JsonIgnore] is used - #60024

Merged
layomia merged 4 commits into
dotnet:mainfrom
layomia:JsonIgnore
Oct 12, 2021
Merged

Prevent runtime prop metadata retrieval when [JsonIgnore] is used#60024
layomia merged 4 commits into
dotnet:mainfrom
layomia:JsonIgnore

Conversation

@layomia

Copy link
Copy Markdown
Contributor

Fixes#59936, a 6.0 regression. Contributes to #59364.

@ghost

ghost commented Oct 5, 2021

Copy link
Copy Markdown

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

Issue Details

Fixes #59936, a 6.0 regression. Contributes to #59364.

Author:layomia
Assignees:-
Labels:

area-System.Text.Json

Milestone:6.0.0

Comment threadsrc/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs Outdated
@layomia
layomiaforce-pushed the JsonIgnore branch 2 times, most recently from c43b151 to ffb733fCompareOctober 6, 2021 20:39
Comment threadsrc/libraries/System.Text.Json/tests/Common/PropertyVisibilityTests.cs Outdated
Comment threadsrc/libraries/System.Text.Json/tests/Common/PropertyVisibilityTests.cs Outdated
@layomia
layomiaforce-pushed the JsonIgnore branch 5 times, most recently from d901f29 to 6112780CompareOctober 11, 2021 17:26
@layomia
layomiaforce-pushed the JsonIgnore branch 2 times, most recently from 08945c3 to ae2f69cCompareOctober 11, 2021 20:28

@stevehartersteveharter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming green CI

JsonSerializerOptions options)
{
JsonPropertyInfo jsonPropertyInfo = converter.CreateJsonPropertyInfo();
JsonPropertyInfo jsonPropertyInfo = new JsonPropertyInfo<sbyte>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a comment here explaining why sbyte is being used?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be sure to do so in a follow up to avoid CI reset. It will be the same as the comment on CreateIgnoredParameterPlaceholder below.

@layomia

Copy link
Copy Markdown
ContributorAuthor

Test failures unrelated.

@layomia
layomia merged commit 784687f into dotnet:mainOct 12, 2021
@layomia

Copy link
Copy Markdown
ContributorAuthor

/backport to release/6.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1333901172

@ghostghost locked as resolved and limited conversation to collaborators Nov 11, 2021
@layomia
layomia deleted the JsonIgnore branch November 18, 2021 20:30
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[System.Text.Json] Regression: [JsonIgnore] Attribute not Applied to Ref Returns

3 participants

@layomia@eiriktsarpalis@steveharter