...

Text file src/github.com/go-openapi/validate/fixtures/validation/fixture-additional-items-2.yaml

Documentation: github.com/go-openapi/validate/fixtures/validation

     1swagger: '2.0'
     2info:
     3  title: additionalItems-2
     4  version: '1.0'
     5  description: 'this spec exercise the additionalItems property on params and responses, with default and example values. This one is invalid.'
     6  license:
     7    name: MIT
     8host: localhost:8081
     9basePath: /api/v1
    10schemes:
    11  - http
    12consumes:
    13  - application/json
    14produces:
    15  - application/json
    16paths:
    17  /servers/getGood:
    18    get:
    19      operationId: getGoodOp
    20      parameters:
    21        - name: addItems
    22          in: body
    23          schema:
    24            type: array
    25            # Unsupported keyword
    26            additionalItems: false
    27            items:
    28              # inline schema
    29              - type: object
    30                properties:
    31                  first:
    32                    type: string
    33              # ref simple schema
    34              - $ref: '#/definitions/itemsSchema0'
    35              # ref multiple complex schemas
    36              - $ref: '#/definitions/itemsSchema1'
    37              - $ref: '#/definitions/itemsSchema2'
    38              - $ref: '#/definitions/itemsSchema3'
    39            default: 
    40              - first: 'Default string'          #<-- validates inline schema
    41              - 'Default string'          #<-- validates scheme0
    42              - x: 'a'                    #<-- validates schema1
    43                c: 1
    44              - z: 1                      #<-- validate  schema2
    45            example: 
    46              - first: 'Default string'          #<-- validates inline schema
    47              - 'A string'                #<-- validates scheme0
    48              - x: 'a'                    #<-- validates schema1
    49                c: 1
    50              - z: 1
    51      responses:
    52        200:
    53          description: 'ok'
    54definitions:
    55  itemsSchema0:
    56    type: string
    57  itemsSchema1:
    58    type: object
    59    required:
    60      - x
    61      - c
    62    properties:
    63      x:
    64        type: string
    65        enum:
    66          - 'a'
    67          - 'b'
    68          - 'c'
    69        default: 'a'
    70        example: 'b'
    71      c:
    72        type: number
    73        default: 1
    74        example: 9
    75    example:
    76      x: 'c'
    77      c: 12
    78  itemsSchema2:
    79    type: object
    80    required:
    81      - z
    82    properties:
    83      z:
    84        type: number
    85        default: 1
    86        example: 9
    87    example:
    88      z: 12
    89  itemsSchema3:
    90    type: array
    91    items:
    92      type: array
    93      items:
    94        type: object
    95        properties:
    96          a:
    97            type: string
    98            default: 'a'
    99            example: 'A'
   100          b:
   101            type: string
   102            default: 'b'
   103            example: 'B'
   104        required: [ a, b ]
   105        default:
   106          a: 'x'
   107          b: 'y'
   108        example:
   109          a: 'u'
   110          b: 'v'
   111      default:
   112        - a: 'u'
   113          b: 'v'
   114      example:
   115        - a: 'u'
   116          b: 'v'
   117    default:
   118      - 
   119        - a: 'a'
   120        - b: 'b'
   121      - 
   122        - a: 'c'
   123        - b: 'd'
   124    example:
   125      - 
   126        - a: 'a'
   127        - b: 'b'
   128      - 
   129        - a: 'c'
   130        - b: 'd'

View as plain text