OAS 3 : allOf specification missing ? #2967
Replies: 2 comments 3 replies
-
You're question is unclear. What exactly are you asking for/about? |
Beta Was this translation helpful? Give feedback.
3 replies
-
This was answered as far as it is relevant to OAS, with the remainder being directed towards JSON Schema. Closing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
Beta Was this translation helpful? Give feedback.
All reactions