github.com/kaisawind/go-swagger@v0.19.0/fixtures/codegen/todolist.discriminators.yml (about)

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "1.0.0"
     5    title: Private to-do list
     6    description: |
     7      A very simple api description that makes a json only API to submit to do's.
     8  
     9  produces:
    10    - application/json
    11  
    12  consumes:
    13    - application/json
    14  
    15  paths:
    16    /models:
    17      put:
    18        operationId: listModels
    19        summary: many model variations list
    20        description: used to see if codegen can render slices with discriminators
    21        tags:
    22          - testcgen
    23        parameters:
    24          - name: pets
    25            in: body
    26            schema:
    27              type: array
    28              items:
    29                $ref: "#/definitions/Pet"
    30        responses:
    31          default:
    32            description: Generic out
    33            schema:
    34              type: array
    35              items:
    36                $ref: "#/definitions/Pet"
    37      post:
    38        operationId: modelOp
    39        summary: many model variations
    40        description: Used to see if a codegen can render all the possible parameter variations for a header param
    41        tags:
    42          - testcgen
    43        parameters:
    44          - name: pet
    45            in: body
    46            schema:
    47              $ref: "#/definitions/Pet"
    48        responses:
    49          default:
    50            description: Generic Out
    51            schema:
    52              $ref: "#/definitions/Pet"
    53          200:
    54            description: OK
    55            schema:
    56              $ref: "#/definitions/Pet"
    57  
    58  definitions:
    59    WithPet:
    60      type: object
    61      required:
    62        - pet
    63      properties:
    64        id:
    65          type: integer
    66          format: int64
    67        pet:
    68           $ref: "#/definitions/Pet"
    69    Kennel:
    70      type: object
    71      required:
    72        - pets
    73      properties:
    74        id:
    75          type: integer
    76          format: int64
    77        pets:
    78          type: array
    79          items:
    80            $ref: "#/definitions/Pet"
    81    Pet:
    82      type: object
    83      discriminator: petType
    84      properties:
    85        name:
    86          type: string
    87        petType:
    88          type: string
    89      required:
    90      - name
    91      - petType
    92  
    93    cat:
    94      type: object
    95      description: A representation of a cat
    96      allOf:
    97      - $ref: '#/definitions/Pet'
    98      - properties:
    99          huntingSkill:
   100            type: string
   101            description: The measured skill for hunting
   102            default: lazy
   103            enum:
   104            - clueless
   105            - lazy
   106            - adventurous
   107            - aggressive
   108        required:
   109        - huntingSkill
   110  
   111    Dog:
   112      type: object
   113      description: A representation of a dog
   114      allOf:
   115      - $ref: '#/definitions/Pet'
   116      - properties:
   117          packSize:
   118            type: integer
   119            format: int32
   120            description: the size of the pack the dog is from
   121            default: 0
   122            minimum: 0
   123        required:
   124        - packSize
   125  
   126    BFWAccount:
   127      type: object
   128      description: account
   129      xml:
   130        name: account
   131      required:
   132        - id
   133      properties:
   134        id:
   135          type: string
   136        billingEntity:
   137          type: string
   138          enum:
   139            - notification
   140            - organization
   141            - product
   142            - user
   143        crmid:
   144          type: string
   145