# In this one we make sure arrays without items are detected by validation
# Conversely, objects with items are detected with fixture for issue #1238
swagger: '2.0'
info:
  title: issue-1171
  version: 0.0.1
  license:
    name: MIT
host: localhost:8081
basePath: /api/v1
schemes:
  - http
consumes:
  - application/json
produces:
  - application/json
paths:
  '/servers/{server_id}/zones':
    get:
      operationId: listZones
      tags:
        - zones
      parameters:
        - name: server_id
          in: path
          required: true
          type: string
        - name: other_server_id
          in: path
          schema:
            # Invalid array definition
            type: array
            properties:
              other:  
                type: string
      responses:
        '200':
          description: An array of Zones
          schema:
            $ref: '#/definitions/Zones'

  '/server/getBody':
    get:
      operationId: getBody
      parameters:
        - name: yet_other_server_id
          in: body
          schema:
            # Invalid array definition
            type: array
            properties:
              other:  
                type: string
        # param should be named?
        - thestreetwithnoname: storyOfTheStreetsAreMine
          in: body
          type: integer
      responses:
        '200':
          schema:
            $ref: '#/definitions/Zones'

  '/servers/{server_id}/zones/{zone_id}':
    get:
      operationId: listZone
      tags:
        - zones
      parameters:
        - name: server_id
          in: path
          required: true
          type: string
        - name: zone_id
          type: string
          in: path
          required: true
      responses:
        '200':
          description: A Zone
          schema:
            $ref: '#/definitions/Zone'
        '201':
          description: An invalid Zone
          schema:
            $ref: '#/definitions/InvalidZone'
        '203':
          description: An empty Zone
          schema:
            $ref: '#/definitions/EmptyZone'


definitions:
  # An array must have an  items definition
  Zones:
    type: array
    properties:
      name:
        type: string
  Zone:
    type: array
    items:
      type: string
  InvalidZone:
    type: array
    items:
      # This is a forbidden property
      name:
        type: string
  EmptyZone:
    type: array
    # Empty description: no error
    items:
