[Bug]: OpenAPI - Discriminator properties are not consistently marked as required #4444
Open
4 tasks done
Labels
Milestone
Describe the bug
AutoRest requires that discriminator properties are marked as required in their schemas:
DiscriminatorNotRequired | Semantic violation: Discriminator must be a required property.
However, schemas emitted by OpenAPI3 emitter do not consistently appear in the set of required properties for both @createsResource and @updatesResource decorated operations.
Reproduction
Produces:
When attempting to generate autorest:
One can attempt to work around by modifying the Animal model as follows:
This fixes the schema that is used for Create and Read, but the schema for update loses
kind
as a required property:Checklist
The text was updated successfully, but these errors were encountered: