-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Ignore overridden properties in JSON (de)serialization #52036
Conversation
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsFixes #51165 Implicitly ignore properties that are overridden in a derived class but have a differing name set by JsonPropertyName.
|
A breaking change here for correctness in this edge case seems fine. The proposed changes in this PR seem safe and reasonable, but would need to come after this other PR that unifies the property visibility semantics between the source-gen and non-source gen programming models: #54526. |
@devsko, thanks for the PR! Unfortunately, per the tracking issue #51165 (comment), I do think it's a bit late in the release cycle to introduce this breaking change. We'll ping this PR when we circle back in .NET 7. |
Fixes #51165
Implicitly ignore properties that are overridden in a derived class but have a differing name set by
JsonPropertyName
.This meets the current behavior of overridden properties with the same name or no
JsonPropertyName
at all.Also fixes an issue with
new virtual
properties that were previously handled asoverride
.This seems to be a breaking change of the scenario described in #51165.