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

Support allOf type in OpenAPI #107

Open
oliyh opened this issue Mar 8, 2021 · 1 comment
Open

Support allOf type in OpenAPI #107

oliyh opened this issue Mar 8, 2021 · 1 comment

Comments

@oliyh
Copy link
Owner

oliyh commented Mar 8, 2021

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#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.

e.g.

author: {
  description: "Details of the user who attached the file.",
  readOnly: true,
  allOf: [
    {
      $ref: "#/components/schemas/User"
    }
  ]
}
@jwhitlark
Copy link

Note that there are several related properties: oneOf, anyOf. I've run into this trying to use martian in the field.
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/

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

2 participants