-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Added setting UsePolymorphicSerialization #462
Conversation
when true a CustomTemplateFactory is used that overrides the NSwag DefaultTemplateFactory behavior
@ryanheath Thanks for taking the time to investigate and implement this. I'll start reviewing this immediately |
@all-contributors please add @ryanheath for code |
I've put up a pull request to add @ryanheath! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanheath I just have a few minor suggestions, but all-in-all this looks great!
src/Refitter.Tests/Examples/UseSystemTextJsonPolymorphicSerializationTests.cs
Outdated
Show resolved
Hide resolved
The tests are still failing because of a static template dictionary deep down in the nwag or nschema sources. |
…ion into custom template models to be used in the liquid template files ...
Quality Gate passedIssues Measures |
I have added a lot more override and custom implementation of NSwag/NSchema generators and models. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #462 +/- ##
===========================================
- Coverage 96.04% 85.95% -10.09%
===========================================
Files 73 50 -23
Lines 3991 2769 -1222
===========================================
- Hits 3833 2380 -1453
- Misses 116 357 +241
+ Partials 42 32 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @ryanheath
Yeah, I agree. It looks needlessly complicated and harder than it should be. Let's merge this in |
Thank you @christianhelle! |
@christianhelle what else should we do to get a new (pre) release nuget? |
I can create a pre-release now as it is so that you can use it |
@ryanheath I was planning to update the docs tonight but then I can just do another pre-release with the new docs |
Fixes #459 and Unknown subtype causes Stackoverflow exception at deserialization
Loosely based on Add support for STJ-native C# code gen
When UseSystemTextJsonPolymorphicSerialization is set to true
a CustomTemplateFactory is used that overrides the NSwag DefaultTemplateFactory behavior.
The STJ polymorphic attributes are rendered instead of NSwag own polymorphic attributes.