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

Honor JsonSerializerOptions.PropertyNameCaseInsensitive in property name conflict resolution. #93933

Merged

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Oct 24, 2023

The PR in #81306 among other things consolidated the property name conflict resolution algorithm to a shared location in JsonTypeInfo, however the shared logic didn't account for the JsonSerializerOptions.PropertyNameCaseInsensitive setting. This PR rectifies the issue and adds a regression test.

Fix #93903.

@ghost
Copy link

ghost commented Oct 24, 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

The PR in #81306 among other things consolidated the property name conflict resolution algorithm to a shared location in JsonTypeInfo, however the shared logic didn't account for the JsonSerializerOptions.PropertyNameCaseInsensitiveSetting. This PR rectifies the issue and adds a regression test.

Fix #93903.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@eiriktsarpalis eiriktsarpalis added this to the 9.0.0 milestone Oct 24, 2023
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
@eiriktsarpalis
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6630600960

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

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

Added a small suggestion. LGTM otherwise.

@eiriktsarpalis eiriktsarpalis merged commit b09e18e into dotnet:main Oct 24, 2023
109 checks passed
@eiriktsarpalis eiriktsarpalis deleted the fix/json-case-insensitive-bug branch October 24, 2023 20:30
liveans pushed a commit to liveans/dotnet-runtime that referenced this pull request Nov 9, 2023
…ame conflict resolution. (dotnet#93933)

* Honor JsonSerializerOptions.PropertyNameCaseInsensitive in property name conflict resolution.

* Update src/libraries/System.Text.Json/tests/Common/PropertyNameTests.cs

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>

* Address feedback

---------

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
@ghost ghost locked as resolved and limited conversation to collaborators Nov 24, 2023
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.

The JsonIgnore is being ignored causing property collisions with PropertyNameCaseInsensitive set to true
3 participants