---
swagger: "2.0"
info:
  version: "0.1.0"
  title: issue#859. Reference validation
  description: more exercising on $ref recursion,default response,items
paths:
  /:
    post:
      parameters:
        - $ref: "#/parameters/rateLimit"
      responses:
        200:
          description: "Success"
    get:
      parameters:
        - name: myparam
          in: body
          schema:
            $ref: '#/definitions/myparam'
      responses:
        default:
          description: the record
          schema:
            $ref: "#/definitions/record"
        404:
          $ref: "#/responses/notFound"
        200:
          description: "Success"
          schema:
            $ref: "#definitions/myoutput"
        201:
          description: "Success"
          schema:
            $ref: "#definitions/myoutput"

parameters:
  rateLimit:
    name: X-Rate-Limit
    in: header
    type: integer
    format: int32

responses:
  notFound:
    description: Not found
    schema:
      $ref: "#/definitions/record"

definitions:
  record:
    type: object
    properties:
      createdAt:
        type: string
        format: date-time
  myparam:
    type: array
    items:
      $ref: "#/definitions/myitems"
  myoutput:
    type: array
    items:
      # Error: unresolved
      $ref: "#/definitions/myitem"
  myitems:
    type: object
    properties:
      ident:
        type: string
