github.com/kaisawind/go-swagger@v0.19.0/fixtures/bugs/1571/fixture-simple-tuple.yaml (about)

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "1.0.0"
     5    title: simple fixture for enums with additional items
     6    description: |
     7      A basic test of enum validation generation for tuples and additionalItems.
     8  produces:
     9    - application/json
    10  consumes:
    11    - application/json
    12  paths:
    13    /models:
    14      get:
    15        operationId: modelOp
    16        summary: many model variations
    17        description: Used to see if a codegen can render all the possible enum categories
    18        tags:
    19          - testcgen
    20        responses:
    21          default:
    22            description: Generic Out
    23  definitions:
    24    trueTupleThing:
    25      type: array
    26      additionalItems: true
    27      items:
    28        - type: number 
    29        - type: string 
    30    falseTupleThing:
    31      type: array
    32      additionalItems: false
    33      items:
    34        - type: number 
    35        - type: string 
    36    tupleThing:
    37      type: array
    38      # This array defines a tuple
    39      items:
    40        # P0
    41        - type: string 
    42          enum: 
    43            - 'CONST1'
    44            - 'CONST2'
    45        # P1
    46        - type: string
    47          enum: 
    48            - 'CONST3'
    49            - 'CONST4'
    50    tupleThingWithAdditionalItems:
    51      type: array
    52      items:
    53        # P0
    54        - type: string 
    55        # P1
    56        - type: integer
    57          maximum: 10
    58      additionalItems:
    59        # Additional item type #1
    60        type: integer
    61        enum:
    62        - 1
    63        - 2
    64    tupleThingWithNoAdditionalItems:
    65      type: array
    66      items:
    67        # P0
    68        - type: string 
    69        # P1
    70        - type: integer
    71          maximum: 10
    72      additionalItems: false
    73    tupleThingWithAnyAdditionalItems:
    74      type: array
    75      uniqueItems: true       # <- should be part of the validation
    76      items:
    77        # P0
    78        - type: string 
    79          maxLength: 10
    80        # P1
    81        - type: integer
    82          maximum: 10
    83      additionalItems: true
    84    tupleThingWithNotNullable:
    85      type: array
    86      uniqueItems: true
    87      items:
    88        # P0
    89        - type: string 
    90          maxLength: 10
    91          x-nullable: false
    92        # P1
    93        - type: integer
    94          maximum: 10
    95      additionalItems: true
    96    tupleThingWithArrayElement:
    97      type: array
    98      uniqueItems: true
    99      items:
   100        # P0
   101        - type: array 
   102          maxItems: 10
   103          items:
   104            type: string
   105            maxLength: 10
   106        # P1
   107        - type: array
   108          minItems: 20
   109          items:
   110            type: integer
   111            minimum: 10
   112      additionalItems:
   113        type: array
   114        items:
   115          type: string
   116          format: date
   117    tupleThingWithMapElement:
   118      type: array
   119      uniqueItems: true
   120      items:
   121        # P0
   122        - type: object 
   123          additionalProperties:
   124            type: string
   125            maxLength: 10
   126        # P1
   127        - type: object
   128          additionalProperties:
   129            type: integer
   130            minimum: 10
   131      additionalItems:
   132        type: object
   133        additionalProperties:
   134          type: string
   135          format: date
   136    arrayOfTuples:
   137      type: array
   138      minItems: 1
   139      items:
   140        type: array
   141        uniqueItems: true
   142        items:
   143          # P0
   144          - type: array 
   145            maxItems: 10
   146            items:
   147              type: string
   148              maxLength: 10
   149          # P1
   150          - type: array
   151            minItems: 20
   152            items:
   153              type: integer
   154              minimum: 10
   155        additionalItems:
   156          type: array
   157          items:
   158            type: string
   159            format: date
   160    tupleThingWithObjectElement:
   161      type: array
   162      uniqueItems: true
   163      items:
   164        # P0
   165        - type: object 
   166          properties:
   167            prop1:
   168              type: string
   169              maxLength: 10
   170        # P1
   171        - type: object
   172          additionalProperties:
   173            type: integer
   174            minimum: 10
   175      additionalItems:
   176        type: object
   177        additionalProperties:
   178          type: string
   179          format: date