As per your suggestion I added a C# client generator setting named JsonPolymorphicSerializationStyle that defaults to NSwag (old behavior). Setting it to SystemTextJson will opt into the new behavior:
Generate JsonPolymorphic and JsonDerivedType attributes
Don't generate JsonInheritanceConverter and JsonInheritanceAttribute classes
I took another crack at adding the missing System.Text.Json polymorphic serialization features to NSwag's C# client generator (previous PR: https://github.com/RicoSuter/NJsonSchema/pull/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