-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Inheritance hierarchy not flattened by default #2514
Comments
I can confirm this bug occurs on v6.5.0 as well. The issue lies in Wherein if In the current design, The fix is to use the current design for when both This new design would need to add the discriminator properties to all the |
I have submitted a Pull Request #2683 that fixes this bug. |
This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made. |
According to the docs:
However, when using the Shape-Rectange-Circle hierarchy (as in the tests), the schema generated with
Swashbuckle.AspNetCore.Swagger v6.4.0
still includes the base (parent) fields via allOf.Expected:
name
andtypeName
to end up underCircle
-> properties.Actual:
allOf
that referencesShape
is underCircle
, despite not callingc.UseAllOfForInheritance()
in the code.Here is an (almost) minimal repro with .NET 6 (Program.cs):
And here is the
WebApplication1.csproj
file:The text was updated successfully, but these errors were encountered: