...

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

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

     1swagger: '2.0'
     2info:
     3  title: items of items in simple schema
     4  version: '1.0'
     5  description: i describe
     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'
    54  /servers/getUp/{soSimple}:
    55    get:
    56      operationId: getOnTheGoodFoot
    57      parameters:
    58        - name: soSimple
    59          in: path
    60          type: array
    61          required: true
    62          items:
    63            type: array
    64            items:
    65              type: integer
    66            default:
    67            - 1
    68            - 2
    69            #example:
    70            #- 1
    71            #- 2
    72          default:
    73          -
    74            - 1
    75            - 2
    76          -
    77            - 1
    78            - 2
    79      responses:
    80        200:
    81          description: 'ok'
    82definitions:
    83  itemsSchema0:
    84    type: string
    85  itemsSchema1:
    86    type: object
    87    required:
    88      - x
    89      - c
    90    properties:
    91      x:
    92        type: string
    93        enum:
    94          - 'a'
    95          - 'b'
    96          - 'c'
    97        default: 'a'
    98        example: 'b'
    99      c:
   100        type: number
   101        default: 1
   102        example: 9
   103    example:
   104      x: 'c'
   105      c: 12
   106  itemsSchema2:
   107    type: object
   108    required:
   109      - z
   110    properties:
   111      z:
   112        type: number
   113        default: 1
   114        example: 9
   115    example:
   116      z: 12
   117  itemsSchema3:
   118    type: array
   119    items:
   120      type: array
   121      items:
   122        type: object
   123        properties:
   124          a:
   125            type: string
   126            default: 'a'
   127            example: 'A'
   128          b:
   129            type: string
   130            default: 'b'
   131            example: 'B'
   132        required: [ a, b ]
   133        default:
   134          a: 'x'
   135          b: 'y'
   136        example:
   137          a: 'u'
   138          b: 'v'
   139      default:
   140        - a: 'u'
   141          b: 'v'
   142      example:
   143        - a: 'u'
   144          b: 'v'
   145    default:
   146      - 
   147        - a: 'a'
   148        - b: 'b'
   149      - 
   150        - a: 'c'
   151        - b: 'd'
   152    example:
   153      - 
   154        - a: 'a'
   155        - b: 'b'
   156      - 
   157        - a: 'c'
   158        - b: 'd'

View as plain text