openapi: 3.0.0
info:
  title: ONE-OF with combinations of various data types
  version: '1.0'
paths:
  /one-of-array-and-object:
    get:
      summary: One-Of Array and Object
      tags:
        - ONE-OF Combinations
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  single:
                    oneOf:
                      - type: string
                      - type: object
                        properties:
                          x:
                            type: string
                          y:
                            type: string
                  multiple:
                    type: array
                    items:
                      oneOf:
                        - type: string
                        - type: object
                          properties:
                            x:
                              type: string
                            y:
                              type: string
  /one-of-primitives-and-object:
    get:
      summary: One-Of Object and premitives
      tags:
        - ONE-OF Combinations
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  a:
                    type: string
                  b:
                    type: string
                  c:
                    oneOf:
                      - type: boolean
                      - type: number
                      - type: string
                      - type: object
                        properties:
                          x:
                            type: string
                          y:
                            type: string
                      - type: array
                        title: Cordinates
                        description: Array of Object
                        items:
                          type: object
                          properties:
                            x:
                              type: string
                            y:
                              type: string
                      - type: array
                        title: Array title
                        description: Array of string with title and description
                        items:
                          type: string
                          title: Array Item Title
                      - type: array
                        description: Array of string without a title but has a description
                        items:
                          type: string
                          title: Array Item Title
                      - type: string
                        description: Primitive with a title
                        title: ID number
                      - type: integer
                        description: Primitive without a title
                      - type: 'null'
                        description: Null with a title
                        title: Null with a title
                      - type: 'null'
                        description: Null without a title                            
                  d:
                    type: string
  /any-of-options-with-array-as-root:
    post:
      summary: ANY-OF Options with Array as root
      tags:
        - ANY-OF Root as Array / Object
      requestBody:
        description: ANY OF Option where root element is an array
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - title: Option 1
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      age:
                        type: integer
                - title: Option 2
                  type: array
                  items:
                    type: object
                    properties:
                      location:
                        type: string
                      pin:
                        type: integer
  
  /any-of-options-with-object-as-root:
    post:
      summary: ANY-OF Options with Object as root
      tags:
         - ANY-OF Root as Array / Object
      requestBody:
        description: ANY OF Option where root element is an object
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - title: Option 1
                  type: object
                  properties:
                    name:
                      type: string
                    age:
                      type: integer
                - title: Option 2
                  type: object
                  properties:
                    location:
                      type: string
                    zip:
                      type: integer
