schemes:
  - https
securityDefinitions:
  api_token:
    type: apiKey
    in: header
    name: Swagger-Token
definitions:
  BaseModel:
    description: BaseModel is the top-level definition in this example
    type: object
    properties:
      directChildren:
        description: A nested array of direct recursive models.
        type: array
        items:
          $ref: '#/definitions/DirectRecursiveModel'
      indirectChildren:
        description: A nested array of indirect recursive models.
        type: array
        items:
          $ref: '#/definitions/IndirectRecursiveModelOne'
    additionalProperties: false
    required:
      - directChildren
      - indirectChildren
  DirectRecursiveModel:
    description: DirectRecursiveModel is a nested model which can optionally contain itself.
    type: object
    properties:
      children:
        description: A nested array of direct recursive models.
        type: array
        items:
          $ref: '#/definitions/DirectRecursiveModel'
    additionalProperties: false
  IndirectRecursiveModelOne:
    description: IndirectRecursiveModelOne is a nested model which can optionally contain IndirectRecursiveModelTwo.
    type: object
    properties:
      children:
        description: A nested array of indirect recursive models.
        type: array
        items:
          $ref: '#/definitions/IndirectRecursiveModelTwo'
    additionalProperties: false
  IndirectRecursiveModelTwo:
    description: IndirectRecursiveModelTwo is a nested model which can optionally contain IndirectRecursiveModelOne.
    type: object
    properties:
      children:
        description: A nested array of indirect recursive models.
        type: array
        items:
          $ref: '#/definitions/IndirectRecursiveModelOne'
    additionalProperties: false
security:
  - api_token: []
produces:
  - application/json
paths:
  /baseModels:
    post:
      parameters:
        - in: body
          name: BaseModel
          description: ''
          required: true
          schema:
            $ref: '#/definitions/BaseModel'
      responses:
        '201':
          schema:
            $ref: '#/definitions/BaseModel'
          description: Resource
        '400':
          description: Schema mismatch
        '404':
          description: Resource does not exist
        '422':
          description: Unprocessable
      operationId: createBaseModel
      description: Create BaseModel allows you to create a new BaseModel
      summary: Create BaseModel
consumes:
  - application/json
host: api.app.example.com
info:
  title: Valid Recursive Definition Example
  version: '1.0'
  description: This example contains a recursive model definition which is valid because DirectRecursiveModel's "children" property is optional.
swagger: '2.0'
basePath: /
