Skip to content

S.T.J source-gen reflection fallback and switching from AddContext to TypeInfoResolver #74359

Discussion options

You must be logged in to vote

Am I correct that this will continue to use source-gen for annotated types and fallback to reflection otherwise?

That's right.

Is there a way around the inaccessible class-level converter issue for unowned types in general?

Not really, it might make sense to request a JsonSerializerContext exposed by the authors of the inaccessible class and then combine those with your own contexts.

I tried digging through the code a bit and it seems like the only extra thing that AddContext does is bind the current options instance to the JsonSerializerContext.

That's also true for the case of TypeInfoResolver. What AddContext does differently is that it initializes a brand new JsonSerializerContext

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pinkfloydx33
Comment options

Answer selected by pinkfloydx33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants