Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schnerring
Copy link

@schnerring schnerring commented Feb 13, 2024

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 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 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

@brrusino
Copy link

@schnerring @RicoSuter What's the latest status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants