Polymorphic derived types do not have discriminator property marked as required in OpenAPI schema. #60469
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-openapi
Is there an existing issue for this?
Describe the bug
Generated schema
In the schema, FooBar and FooBaz have required properties, but critically the discriminator property
$type
is not required,even though it is required in the base class Foo. This is inconsistent and can cause issues when e.g.
trying to generate TypeScript classes from the Open API schema.
Expected Behavior
Expected generated schema
Steps To Reproduce
An example reproducing this issue can be found at https://github.com/andrewimcclement/openApiDiscriminatorIssue.
Exceptions (if any)
No response
.NET Version
9.0.2
Anything else?
ASP.NET Core version: 9.0.2.
I do not believe this is the same as #57982
The text was updated successfully, but these errors were encountered: