Remove fallback to reflection converter resolution#72228
Merged
eiriktsarpalis merged 7 commits intodotnet:mainfrom Jul 16, 2022
Merged
Remove fallback to reflection converter resolution#72228eiriktsarpalis merged 7 commits intodotnet:mainfrom
eiriktsarpalis merged 7 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsContributes to #71714 by removing fallback to the reflection converters for any resolver other than the default reflection-based resolver. More specifically this change:
|
eiriktsarpalis
commented
Jul 14, 2022
krwq
reviewed
Jul 15, 2022
krwq
reviewed
Jul 15, 2022
…Info & EffectiveConverter
… caching context.
krwq
reviewed
Jul 15, 2022
krwq
reviewed
Jul 15, 2022
krwq
reviewed
Jul 15, 2022
krwq
reviewed
Jul 15, 2022
…a shared caching context." This reverts commit 4f10c60.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to #71714 by removing fallback to the reflection converters for any resolver other than the default reflection-based resolver. More specifically this change:
DefaultContractResolver(andJsonSerializerOptions.GetConverterwhenever a resolver is left unspecified for backward compatibility purposes).JsonPropertyInfoexplicitly lazy unless theJsonTypeInfofor the declared type has already been cached.JsonSerializerOptions.GetConverterfor options instances tied toJsonSerializerContext: the method will throwNotSupportedExceptionfor any type not explicitly supported by the context and will not query the reflection-based converter factories. This change is inline with the proposal in Remove implicit fallback to reflection-based serialization in System.Text.Json sourcegen #71714.Nullable<T>and F# optionals: types whose converters perform eager resolution for the converters of their element types.Fix #71714.