Skip to content
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

OAS 3 : allOf specification missing ? #318

Open
jonathan-vandebosch opened this issue Jul 8, 2022 · 0 comments
Open

OAS 3 : allOf specification missing ? #318

jonathan-vandebosch opened this issue Jul 8, 2022 · 0 comments

Comments

@jonathan-vandebosch
Copy link

Hello Everyone,

I was wondering why the allOf at array level was not documented, because it is working perfectly :

(in the screenshot the swagger has been simplified for clarity purposes)

image

image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant