openapi: 3.0.0
info:
  title: Multiple One-Of Test
  version: 1.0.0
paths:
  "/multiple-one-of":
    get:
      summary: Multiple One of
      description: Schema composition using multiple `one-of` 
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Data"
components:
  schemas:
    Woman:
      properties:
        haircolor:
          type: string
    Man:
      properties:
        weight:
          type: integer
    Young:
      properties:
        schoolName:
          type: string
    Old:
      properties:
        employerName:
          type: string
    Data:
      allOf:
      - type: object
        properties:
          id:
            type: integer
          name:
            type: string
      - oneOf:
        - "$ref": "#/components/schemas/Woman"
        - "$ref": "#/components/schemas/Man"
      - oneOf:
        - "$ref": "#/components/schemas/Young"
        - "$ref": "#/components/schemas/Old"
      - properties:
          language:
            type: string