-
Notifications
You must be signed in to change notification settings - Fork 604
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I have JsonSerializerOptions which only adds some converters and set the naming policy. I don't have a source generated JsonSerializerContext and therefore no TypeInfoResolver.
When passing these options to a WithTools function, I get the exception:
JsonSerializerOptions instance must specify a TypeInfoResolver setting before being marked as read-only.
I understand that making these options read only is a good thing, but I don't understand enough about the difference to the overload of MakeReadOnly(populateMissingResolver) on the options.
I can set TypeInfoResolver = new DefaultJsonTypeInfoResolver() on my options, but that seems a bit weird.
To Reproduce
Steps to reproduce the behavior:
- Pass a
new System.Text.Json.JsonSerializerOptions()object to one of theWithToolsfunctions.
Expected behavior
No exception should be thrown.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working