-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Text.Json of T Buggy JsonConverterOfT #1153
Comments
What are you trying to do here with the "buggy" converter and what do you expect the behavior to be? It is hard to parse what you are trying to do here. Does Did you try different registration order of the converters? https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to#sample-factory-pattern-converter |
in I did try different registration order but I got the same result. |
The Please see the docs on how to follow the factory converter pattern which is ideal for writing generic converters. |
If I try to register many custom converters of
T
, inConfigureServices
or elsewhere, and I try to use the custom converter with aCanConvert
overridden method, I get:Indeed, even if the
CanConvert
method returntrue
, theJsonConverter
yieldfalse
…Here a simple (drafty) repro:
The text was updated successfully, but these errors were encountered: