-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
second level inheritance for UseOneOfForPolymorphism #3155
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3155 +/- ##
==========================================
+ Coverage 83.25% 84.51% +1.25%
==========================================
Files 76 76
Lines 3142 3144 +2
Branches 526 527 +1
==========================================
+ Hits 2616 2657 +41
+ Misses 526 487 -39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
Could you also add an example like in the issue description to one of our integration test projects so we have a verification test for this scenario too please?
Fix Annotations discriminator value selector for the 2nd level inheritance
Hello, I added this case to |
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.
ok, all is perfect
The issue or feature being addressed
The
UseAllOfForInheritance
option of schema generator only accounts for direct parents. It makes impossible to generate correct discriminator information for a big inheritance tree.Example
data class structure:
Swagger generator options:
Generated components of the json:
It doesn't include
discriminator
andBaseType
definition.If we remove
SubType
and makeSubSubType
child ofBaseType
we would get the expected generated components:Details on the issue fix or feature implementation
This PR checks all parents until it finds the one which has this class defined as sub type. I added same assertions to test with one level assertions.