-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
Add support for STJ-native C# code gen #1675
Conversation
49c3754
to
ee1b983
Compare
@schnerring @RicoSuter What's the latest status of this PR? |
src/NJsonSchema.CodeGeneration.CSharp/CSharpJsonPolymorphicSerializationStyle.cs
Outdated
Show resolved
Hide resolved
…ymorphicSerializationStyle.NJsonSchema
@RicoSuter Anything else? It's good to go from my side. |
@schnerring Would you mind adding a setting to support JsonUnknownDerivedTypeHandling ? I could do the work if you want me to. // Ryan |
@schnerring @RicoSuter What's the latest status of this PR? It is related to issue RicoSuter/NSwag#4375 which is critical because can lead to denial of service on public APIs |
Which issue #4375 ? |
Sorry about that. This issue - RicoSuter/NSwag#4375 |
Yep in christianhelle/refitter/#462 we worked around it using the STJ-native. |
We're experiencing the same, stackoverflow exceptions on incorrect/missing type discriminator. Any reason why this PR is open for so long? |
Thanks for the PR. Regarding the stackoverflow, I could not really repro this: |
Should we make this the new default or is something missing? |
I took another crack at adding the missing System.Text.Json polymorphic serialization features to NSwag's C# client generator (previous PR: #1595).
As per your suggestion I added a C# client generator setting named
JsonPolymorphicSerializationStyle
that defaults toNSwag
(old behavior). Setting it toSystemTextJson
will opt into the new behavior:JsonPolymorphic
andJsonDerivedType
attributesJsonInheritanceConverter
andJsonInheritanceAttribute
classesI also added a corresponding (WIP) PR in the NSwag repo that might be missing a couple of things: https://github.com/RicoSuter/NSwag/pull/4782/files