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

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "1.0.0"
     5    title: 'issue 1232'
     6    description: verifies marshalling code on discriminated type
     7  produces:
     8    - application/json
     9  consumes:
    10    - application/json
    11  paths:
    12    /pet:
    13      get:
    14        operationId: getPet
    15        summary: many model variations
    16        description: no description
    17        tags:
    18          - testcgen
    19        parameters:
    20        - name: aPet
    21          in: body 
    22          schema: 
    23            $ref: '#/definitions/Pet'
    24        responses:
    25          default:
    26            description: Generic Out
    27            schema:
    28              $ref: '#/definitions/Pet'
    29    /cat:
    30      get:
    31        operationId: getCat
    32        summary: many model variations
    33        description: no description
    34        tags:
    35          - testcgen
    36        parameters:
    37        - name: aCat
    38          in: body 
    39          schema: 
    40            $ref: '#/definitions/Cat'
    41        responses:
    42          default:
    43            description: Generic Out
    44            schema:
    45              $ref: '#/definitions/Pet'
    46  definitions:
    47    Pet:
    48      type: object
    49      discriminator: petType
    50      properties:
    51        name:
    52          type: string
    53        petType:
    54          type: string
    55      required:
    56      - name
    57      - petType
    58  
    59    Cat:
    60      type: object
    61      description: A representation of a cat
    62      allOf:
    63      - $ref: '#/definitions/Pet'
    64      - properties:
    65          huntingSkill:
    66            type: string
    67            description: The measured skill for hunting
    68            default: lazy
    69            enum:
    70            - clueless
    71            - lazy
    72            - adventurous
    73            - aggressive
    74        required:
    75        - huntingSkill