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

[release/9.0-staging] Fix case-insensitive JSON deserialization of enum member names #112057

Open
wants to merge 3 commits into
base: release/9.0-staging
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 31, 2025

Backport of #112028 to release/9.0-staging

/cc @eiriktsarpalis @PranavSenthilnathan

Customer Impact

  • Customer reported
  • Found internally

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

  • Yes
  • No

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.

Copy link
Contributor

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

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.

Copy link
Member

@jeffhandley jeffhandley left a 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 Issue for next servicing release review label.

@PranavSenthilnathan PranavSenthilnathan added the Servicing-consider Issue for next servicing release review label Feb 3, 2025
@jeffhandley jeffhandley changed the base branch from release/9.0 to release/9.0-staging February 4, 2025 18:11
@jeffhandley
Copy link
Member

@PranavSenthilnathan / @eiriktsarpalis -- I overlooked that this backport had been queued up against release/9.0 instead of release/9.0-staging. I just re-targeted it.

@jeffhandley jeffhandley changed the title [release/9.0] Fix case-insensitive JSON deserialization of enum member names [release/9.0-staging] Fix case-insensitive JSON deserialization of enum member names Feb 4, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 4, 2025
@rbhanda rbhanda added this to the 9.0.3 milestone Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Text.Json Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants