Skip to content

Conversation

@eiriktsarpalis
Copy link
Member

  • Updates JsonTypeInfoResolver.Combine so that it tolerates null arguments and flattens already combined arguments.
  • Updates JsonSerializerOptions.AddContext so that it appends the specified resolver to any already configured TypeInfoResolver configuration. The new context also no longer encapsulates the options instance, making it read-only. This can be a breaking change in certain scenaria.

Fixes #80527.

@ghost
Copy link

ghost commented Jan 16, 2023

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned eiriktsarpalis Jan 16, 2023
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Jan 16, 2023
@ghost
Copy link

ghost commented Jan 16, 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
  • Updates JsonTypeInfoResolver.Combine so that it tolerates null arguments and flattens already combined arguments.
  • Updates JsonSerializerOptions.AddContext so that it appends the specified resolver to any already configured TypeInfoResolver configuration. The new context also no longer encapsulates the options instance, making it read-only. This can be a breaking change in certain scenaria.

Fixes #80527.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json, new-api-needs-documentation

Milestone: -

@eiriktsarpalis eiriktsarpalis merged commit 9a6686b into dotnet:main Jan 17, 2023
@eiriktsarpalis eiriktsarpalis deleted the update-add-context branch January 17, 2023 14:53
@ghost ghost locked as resolved and limited conversation to collaborators Feb 16, 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.

JsonSerializerOptions.AddContext should allow context composition

3 participants