-
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
[release/9.0-staging] Fix case-insensitive JSON deserialization of enum member names #112057
base: release/9.0-staging
Are you sure you want to change the base?
[release/9.0-staging] Fix case-insensitive JSON deserialization of enum member names #112057
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the PR review is completed and the template is filled out, please apply the
Servicing-consider
...raries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs
Outdated
Show resolved
Hide resolved
...raries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs
Show resolved
Hide resolved
...raries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs
Outdated
Show resolved
Hide resolved
@PranavSenthilnathan / @eiriktsarpalis -- I overlooked that this backport had been queued up against |
Backport of #112028 to release/9.0-staging
/cc @eiriktsarpalis @PranavSenthilnathan
Customer Impact
When deserializing a string into an enum using a naming policy, if the C# enum member name is the same as its name derived from the naming policy, then the deserialization will be case sensitive. This prevents some values from being deserialized successfully in .NET 9.0 which previously worked fine in .NET 8.0. Reported in #110745.
Regression
Introduced in #105032.
Testing
User scenario was validated manually and new unit tests have been added to cover it.
Risk
Low. This is a targeted change that fixes the handling of a corner case that got regressed in .NET 9.