-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Hello Everyone,
I was wondering why the allOf at array level with items was not documented, because it is working perfectly :
(in the screenshot the swagger has been simplified for clarity purposes)
But because of the spec mentionned at https://spec.openapis.org/oas/latest.html :
4.8.24.2.1 Composition and Inheritance (Polymorphism) §
The OpenAPI Specification allows combining and extending model definitions using the allOf property of JSON Schema, in effect offering model composition. allOf takes an array of object definitions that are validated independently but together compose a single object.
While composition offers model extensibility, it does not imply a hierarchy between the models. To support polymorphism, the OpenAPI Specification adds the discriminator field. When used, the discriminator will be the name of the property that decides which schema definition validates the structure of the model. As such, the discriminator field MUST be a required field. There are two ways to define the value of a discriminator for an inheriting instance.
My company is using those specs to validate swaggers, and because of that my AllOf is refused.

