...

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

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

     1swagger: '2.0'
     2info:
     3  title: code generation test fixture for parameters, with default values
     4  version: '1.0.0'
     5host: localhost
     6basePath: /
     7consumes:
     8  - application/json
     9produces:
    10  - application/json
    11schemes:
    12  - http
    13paths:
    14  /headon:
    15    get:
    16      operationId: gimmeLottaHeaders
    17      parameters:
    18      - name: sampleParam
    19        in: query
    20        type: string
    21      responses: &stdResponses
    22        200:
    23          description: sanity check name mangling for headers
    24          headers: &myHeaders
    25            sanity_check_header_1:
    26              type: string
    27              format: uuid
    28            sanity-check-header-2:
    29              type: string
    30              format: date
    31            sanityCheckHeader3:
    32              type: integer
    33              format: uint32
    34            sanityCheckHeader3:
    35              type: integer
    36              format: uint32
    37            X-sanityCheckHeader4:
    38              type: string
    39              format: password
    40              pattern: '^\w+$'
    41            # headers with collections
    42            X-DeepHeader1:
    43              type: array
    44              # implicit: collectionFormat=csv
    45              items:
    46                type: integer
    47                format: uint64
    48                maximum: 50
    49            X-DeepHeader2:
    50              type: array
    51              collectionFormat: pipes
    52              items:
    53                type: array
    54                collectionFormat: csv
    55                uniqueItems: true
    56                items:
    57                  type: array
    58                  collectionFormat: tsv
    59                  maxItems: 10
    60                  items:
    61                    type: string
    62                    format: duration
    63          schema:
    64            type: string
    65            format: date
    66        201:
    67          description: headers with default values
    68          headers: &myDefaultHeaders
    69            sanity_check_header_0:
    70              type: string
    71              default: simple string
    72            sanity_check_header_float:
    73              type: number
    74              default: 9.99
    75            sanity_check_header_1:
    76              type: string
    77              format: uuid
    78              default: a8098c1a-f86e-11da-bd1a-00112444be1e
    79            sanity-check-header-2:
    80              type: string
    81              format: date
    82              default: x1972-01-01
    83            sanityCheckHeader3:
    84              type: integer
    85              format: uint32
    86              default: 100
    87            sanityCheckHeader3:
    88              type: number
    89              format: float32
    90              default: 1.45
    91            X-sanityCheckHeader4:
    92              type: string
    93              format: password
    94              pattern: '^\w+$'
    95              default: abc
    96            # headers with collections
    97            X-DeepHeader1:
    98              type: array
    99              # implicit: collectionFormat=csv
   100              items:
   101                type: integer
   102                format: uint64
   103                maximum: 50
   104              default:
   105              - 1
   106              - 2
   107              - 3
   108            X-DeepHeader2:
   109              type: array
   110              collectionFormat: pipes
   111              items:
   112                type: array
   113                collectionFormat: csv
   114                uniqueItems: true
   115                items:
   116                  type: array
   117                  collectionFormat: tsv
   118                  maxItems: 10
   119                  items:
   120                    type: string
   121                    format: duration
   122              default:
   123              - 
   124                -
   125                  - 1s
   126                  - 2s
   127                  - 3s
   128                -
   129                  - 1w
   130                  - 2w
   131                  - 3w
   132              - 
   133                -
   134                  - 4s
   135                  - 5s
   136                  - 6s
   137                -
   138                  - 4w
   139                  - 5w
   140                  - 6w
   141            X-DeepHeader3:
   142              type: array
   143              collectionFormat: pipes
   144              items:
   145                type: array
   146                collectionFormat: csv
   147                uniqueItems: true
   148                items:
   149                  type: array
   150                  collectionFormat: tsv
   151                  maxItems: 10
   152                  items:
   153                    type: string
   154                    format: date
   155              default:
   156              - 
   157                -
   158                  - 1999-01-01
   159                  - 1999-01-02
   160                  - 1999-01-03
   161                -
   162                  - 1999-02-01
   163                  - 1999-02-02
   164                  - 1999-02-03
   165              - 
   166                -
   167                  - 2000-01-01
   168                  - 2000-01-02
   169                  - 2000-01-03
   170                -
   171                  - 2000-02-01
   172                  - 2000-02-02
   173                  - 2000-02-03
   174            X-DeepHeader4:
   175              type: array
   176              collectionFormat: pipes
   177              uniqueItems: true
   178              items:
   179                type: string
   180              default:
   181              - this
   182              - is
   183              - a song
   184          schema:
   185            type: string
   186            format: date
   187        default:
   188          description: headers in default response
   189          headers: *myHeaders
   190          schema:
   191            $ref: '#/definitions/errorResponseMsg'
   192definitions:
   193  errorResponseMsg:
   194    type: object 
   195    required: [ errorCode, reason ]
   196    properties:
   197      errorCode:
   198        type: integer
   199      reason:
   200        type: string
   201      severity:
   202        type: string
   203        enum: [ FATAL, CRITICAL, ERROR, WARNING, INFO ]
   204      additional:
   205        type: string
   206        enum: [ FATAL, CRITICAL, ERROR, WARNING, INFO ]
   207        default: INFO
   208    default:
   209      errorCode: 501
   210      reason: not implemented
   211      severity: FATAL

View as plain text