...

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

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

     1swagger: '2.0'
     2info:
     3  title: issue-342
     4  description: |
     5    Original issue: a spec which triggers a panic because of invalid type assertion on parameters.
     6    Specifically, this tests how validation carries on when references returns an unexpected object.
     7    This may happen for parameters and responses and should be accurately reported.
     8  version: 0.0.1
     9  license:
    10    name: MIT
    11host: localhost:8081
    12basePath: /api/v1
    13schemes:
    14  - http
    15consumes:
    16  - application/json
    17produces:
    18  - application/json
    19paths:
    20  /get_main_object:
    21    get:
    22      tags:
    23        - maindata
    24      parameters:
    25        - name: pquery1
    26          in: query
    27          required: true
    28          $ref: "#/definitions/sample_info/properties/sid"  # <-- error: a whole schema replaces the parameter
    29        - $ref: "#/parameters/wrong"  # <-- error: wrong param props
    30        - $ref: "#/parameters/notbetter"  # <-- error: wrong param schema
    31        - $ref: "#/parameters/stillnogood"  # <-- error: wrong param schema
    32        - name: pquery2
    33          in: query
    34          required: true
    35          $ref: "nowhere.yaml#/definitions/sample_info/properties/sid"  # <-- error: expand ref error
    36        - name: sid
    37          in: body
    38          required: true
    39          $ref: "#/definitions/sample_info/properties/sid"  # <-- error: a whole schema replaces the parameter
    40      responses:
    41        '200':
    42
    43parameters:
    44  wrong:
    45    theName: wrongNameProperty
    46    theType: wrongTypePropery
    47  notbetter:
    48    type: object
    49    properties:
    50      whenDidThatHappen:
    51        type: string
    52        format: date
    53  stillnogood:
    54    schema:
    55      type: object
    56      properties:
    57        aintnogood:
    58          type: integer
    59definitions:
    60  sample_info:
    61    type: object
    62    properties:
    63      sid:
    64        type: string
    65        format: uuid
    66

View as plain text