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

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "1.0.0"
     5    title: broken code when using array of polymorphic type
     6    description: broken code produced on polymorphic type
     7  produces:
     8    - application/json
     9  consumes:
    10    - application/json
    11  paths:
    12    /models:
    13      get:
    14        operationId: modelOp
    15        summary: many model variations
    16        description: no description
    17        tags:
    18          - testcgen
    19        parameters: 
    20          - name: sanity 
    21            in: body 
    22            schema: 
    23              $ref: '#/definitions/sanityCheck'
    24        responses:
    25          default:
    26            description: Generic Out
    27  definitions:
    28    sanityCheck:
    29      description: an extensible empty object 
    30      type: object
    31      additionalProperties: true
    32    Graph:
    33      type: object
    34      properties:
    35        Nodes:
    36          type: array
    37          items:
    38            $ref: "#/definitions/Node"
    39    Node:
    40      type: object
    41      discriminator: NodeType
    42      required:
    43        - NodeType
    44      properties:
    45        NodeType:
    46          type: string
    47    CodeBlockNode:
    48      allOf:
    49        - $ref: "#/definitions/Node"
    50        - properties:
    51            Code:
    52              type: string
    53    # Added an addition subtype
    54    DocBlockNode:
    55      allOf:
    56        - $ref: "#/definitions/Node"
    57        - properties:
    58            Doc:
    59              type: string