---
swagger: '2.0'
info:
  version: '0.1.0'
  title: JSON pointers

parameters:
  someParam:
    name: some
    in: query
    type: string
  bodyParam:
    name: some
    in: body
    schema:
      $ref: '#/responses/notFound/schema'
  remoteParam:
    name: some
    in: body
    schema:
      $ref: 'remote.yaml#/remotes/u64'

responses:
  notFound:
    description: 'Not Found'
    schema:
      $ref: '#/definitions/notFound'
  funnyResponse:
    description: ok
    schema:
      $ref: '#/parameters/bodyParam/schema'
  remoteResponse:
    description: ok
    schema:
      type: object
      properties:
        prop0: 
          $ref: 'remote.yaml#/remotes/u64'

paths:
  /some/where:
    parameters:
    - $ref: '#/parameters/someParam'
    get:
      parameters:
      - $ref: '#/parameters/bodyParam' 
      - name: other
        in: query
        type: string
      responses:
        default:
          $ref: '#/responses/notFound'
        404:
          description: ok
          schema:
            $ref: '#/definitions/myResponse'
        200:
          description: 'RecordHolder'
          schema:
            type: object
            properties:
              prop0:
                $ref: '#/definitions/myBody'
    post:
      responses:
        default:
          description: default
          schema:
            $ref: '#/definitions/myDefaultResponse/properties/zzz'
        203:
          description: funny
          schema:
            $ref: '#/responses/funnyResponse/schema'
        204:
          $ref: '#/responses/funnyResponse'
  /some/where/else:
    get:
      responses:
        default:
          description: default
          schema:
            $ref: '#/definitions/notFound'
        200:
          description: ok
          schema:
            $ref: '#/definitions/myDefaultResponse'
  /with/slice/container:
    get:
      responses:
        default:
          description: default
          schema:
            allOf:
            - $ref: 'remote.yaml#/remotes/u64'
            - $ref: 'remote.yaml#/remotes/u32'
            - $ref: '#/definitions/myBody/properties/prop3'
  /with/tuple/container:
    get:
      responses:
        default:
          description: default
          schema:
            type: array
            items:
            - $ref: '#/definitions/myBody/properties/prop2'
            - $ref: '#/definitions/myBody/properties/prop3'
            - $ref: 'remote.yaml#/remotes/i32'
  /with/array/container:
    get:
      responses:
        200:
          description: ok
          schema:
            $ref: '#/definitions/anArray'
        default:
          description: default
          schema:
            type: array
            items:
              $ref: '#/definitions/anArray/items'
  /with/boolable/container:
    get:
      responses:
        200:
          description: ok
          schema:
            type: array
            items:
              - type: integer
              - type: string
            additionalItems:
              $ref: '#/definitions/myBody/properties/prop3'
        default:
          description: default
          schema:
            type: object
            additionalProperties:
              $ref: '#/definitions/myBody/properties/prop3'
  /with/ZcomesFirstInOrder/container:
    get:
      responses:
        200:
          description: ok
          schema:
            type: array
            items:
              - type: integer
              - type: string
            additionalItems:
              $ref: '#/definitions/myBody/properties/prop3'
        203:
          description: ok
          schema:
            $ref: '#/definitions/anExtensible/additionalProperties'
        204:
          description: ok
          schema:
            type: object
            additionalProperties:
              type: object
              additionalProperties:
                $ref: '#/definitions/anExtensible/additionalProperties'
definitions:
  anExtensible:
    type: object
    additionalProperties:
      type: object
      properties:
        addProp1:
          type: string
  anArray:
    type: array
    items:
      type: string
      format: uuid
  notFound:
    type: object
    properties:
      prop1:
        $ref: '#/definitions/myDefaultResponse/properties/zzz'
  myDefaultResponse:
    type: object
    properties:
      zzz:
        type: integer
  myResponse:
    type: object
    additionalProperties:
      $ref: '#/definitions/notFound/properties/prop1'
  myBody:
    type: object
    properties: 
      prop2: 
        type: integer
      prop3:
        $ref: '#/definitions/myDefaultResponse/properties/zzz'
