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

fix: Default JSON serializer instance is not affected by custom global settings for default value handling. #2610

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

amanda-tarafa
Copy link
Contributor

Fixes #2609

@amanda-tarafa amanda-tarafa requested a review from jskeet November 15, 2023 06:21
@amanda-tarafa amanda-tarafa requested a review from a team as a code owner November 15, 2023 06:21
@amanda-tarafa amanda-tarafa merged commit a9fb5df into main Nov 15, 2023
6 checks passed
@amanda-tarafa amanda-tarafa deleted the json-serializer branch November 15, 2023 06:32
amanda-tarafa added a commit that referenced this pull request Nov 17, 2023
…ettings.

This partially superceeds #2610 and it's a better approach overall as our serializar is not created using the global settings at all, so we don't need to override global settings.
Note that JsonConvert.Deserialize uses JsonSerializer.CreateDefault that relies on global settings, and then applies any specific settings. In turn we use JsonSerializer.Create that only applies specific settings. By not using JsonConvert we have stopped being affected by global settings at all.
The test from #2610 remains and proves this approach works.

Possibly fixes #2611
amanda-tarafa added a commit that referenced this pull request Nov 17, 2023
…ettings.

This partially superceeds #2610 and it's a better approach overall as our serializar is not created using the global settings at all, so we don't need to override global settings.
Note that JsonConvert.Deserialize uses JsonSerializer.CreateDefault that relies on global settings, and then applies any specific settings. In turn we use JsonSerializer.Create that only applies specific settings. By not using JsonConvert we have stopped being affected by global settings at all.
The test from #2610 remains and proves this approach works.

Possibly fixes #2611
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants