---
swagger: "2.0"
info:
  version: "0.1.0"
  title: reference analysis

parameters:
  idParam:
    name: id
    in: path
    type: integer
    format: int32
  limitParam:
    name: limit
    in: query
    type: integer
    format: int32
    required: false

responses:
  notFound:
    schema:
      $ref: "#/definitions/error"

paths:
  "/some/where/{id}":
    parameters:
      - $ref: "#/parameters/idParam"

      - name: bodyId
        in: body
        schema:
          type: object
    get:
      parameters:
      - $ref: "#/parameters/limitParam"
      - name: other
        in: query
        type: array
        items:
          # NOTE: $ref here is forbidden in swagger 2.0 
          # however, it is possible to analyze this
          $ref: "#/definitions/named"
      - name: otherHeader
        in: header
        type: array
        items:
          # NOTE: $ref here is forbidden in swagger 2.0 
          # however, it is possible to analyze this
          $ref: "#/definitions/named"
      - name: body
        in: body
        schema:
          type: object
      responses:
        default:
          headers:
            x-array-header:
              type: array
              items:
                # NOTE: $ref here is forbidden in swagger 2.0 
                # however, it is possible to analyze this
                $ref: '#/definitions/named'
          schema:
            type: object
        404:
          $ref: "#/responses/notFound"
        200:
          schema:
            $ref: "#/definitions/tag"
  "/other/place":
    $ref: "#/x-shared-path/getItems"

definitions:
  named:
    type: string
  tag:
    type: object
    properties:
      id:
        type: integer
        format: int64
      value:
        type: string
      audit:
        $ref: "#/definitions/record"
  record:
    type: object
    properties:
      createdAt:
        type: string
        format: date-time
  error:
    type: object
    required:
      - id
      - message
    properties:
      id:
        type: integer
        format: int64
        readOnly: true
      message:
        type: string
        readOnly: true
