Skip to content

OAS 3 : allOf specification missing ? #2966

Closed

Description

@jonathan-vandebosch

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)

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.

Activity

  1. locked and limited conversation to collaborators on Jul 8, 2022
  2. converted this issue into a discussion #2967 on Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions