fix up json pointer (and a couple others)#624
Conversation
| [JsonSerializable(typeof(VocabularyKeyword))] | ||
| [JsonSerializable(typeof(WriteOnlyKeyword))] | ||
| [JsonSerializable(typeof(EvaluationResults))] | ||
| [JsonSerializable(typeof(JsonPointer))] |
There was a problem hiding this comment.
Would like to find a way to just add in the type resolver exposed by JsonPointer rather than have to regen it.
@eiriktsarpalis, any ideas?
There was a problem hiding this comment.
Assuming you're only looking to serialize JsonPointer as a root-level value (and not types containing JsonPointer as a nested values which necessitates regeneration), you could try using this combinator. It can be combined like so:
JsonTypeInfoResolver.Combine(ContextA.Default, ContextB,Default);There was a problem hiding this comment.
I was looking for a way to incorporate it directly into the serializer context.
We eventually found a way using the serializer options. We've extracted it into what is currently called TypeResolverOptionsManager in Json.More. It's not the most elegant right now, but it works by creating a serializer options that includes dependency type resolvers.
No description provided.