Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that types of ignored or inaccessible properties are not included by the source generator. #87383

Merged

Conversation

eiriktsarpalis
Copy link
Member

Makes the following changes:

  1. Ensures that types of ignored/private properties are not included by the source generator.
  2. Refactors the property conflict resolution algorithm so that it is line-by-line equivalent to the reflection variant for consistency and making future changes easier to maintain.
  3. Refactors the SG object parsing logic into distinct methods for constructor, property and property initializer resolution.
  4. Avoids the use of ISymbol.ToDisplayString() in a few places when doing property and interface resolution.

Fix #76919.

@ghost
Copy link

ghost commented Jun 11, 2023

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

Makes the following changes:

  1. Ensures that types of ignored/private properties are not included by the source generator.
  2. Refactors the property conflict resolution algorithm so that it is line-by-line equivalent to the reflection variant for consistency and making future changes easier to maintain.
  3. Refactors the SG object parsing logic into distinct methods for constructor, property and property initializer resolution.
  4. Avoids the use of ISymbol.ToDisplayString() in a few places when doing property and interface resolution.

Fix #76919.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

Copy link
Member

@krwq krwq left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to 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.

Prevent source-gen from generating code for private fields and those marked with JsonIgnore
2 participants