...

Text file src/github.com/go-openapi/analysis/fixtures/oaigen/fixture-oaigen.yaml

Documentation: github.com/go-openapi/analysis/fixtures/oaigen

     1---
     2swagger: '2.0'
     3info:
     4  version: '0.1.0'
     5  title: reference analysis
     6
     7parameters:
     8  someParam:
     9    name: some
    10    in: query
    11    type: string
    12  bodyParam:
    13    name: some
    14    in: body
    15    schema:
    16      # expect this $ref to be kept
    17      $ref: '#/definitions/myBody'
    18
    19responses:
    20  notFound:
    21    description: 'Not Found'
    22    schema:
    23      $ref: '#/definitions/notFound'
    24
    25paths:
    26  /some/where:
    27    parameters:
    28    - $ref: '#/parameters/someParam'
    29    get:
    30      parameters:
    31      - $ref: '#/parameters/bodyParam' 
    32      - name: other
    33        in: query
    34        type: string
    35      responses:
    36        default:
    37          $ref: '#/responses/notFound'
    38        404:
    39          description: ok
    40          schema:
    41            $ref: '#/definitions/myResponse'
    42        304:
    43          description: ok
    44          schema:
    45            $ref: 'transitive-1.yaml#/definitions/transitive-1.1'
    46        204:
    47          description: ok
    48          schema:
    49            $ref: '#/definitions/uniqueName1'
    50        200:
    51          description: 'RecordHolder'
    52          schema:
    53            type: object
    54            properties:
    55              prop0:
    56                $ref: '#/definitions/myBody'
    57        206:
    58          description: ok
    59          schema:
    60            $ref: 'transitive-1.yaml#/definitions/a'
    61        205:
    62          description: ok
    63          schema:
    64            $ref: 'transitive-1.yaml#/definitions/b'
    65    # arbitrary json pointers
    66    post:
    67      responses:
    68        200:
    69          description: ok
    70          schema:
    71            # this one gets resolved
    72            $ref: 'transitive-2.yaml#/definitions/a/properties/b'
    73        204:
    74          description: ok
    75          schema:
    76            # this one gets resolved
    77            $ref: 'transitive-1.yaml#/definitions/c/properties/d'
    78        default:
    79          description: default
    80          schema:
    81            # this one remains (same file)
    82            $ref: '#/definitions/myDefaultResponse/properties/zzz'
    83  /some/where/else:
    84    get:
    85      responses:
    86        default:
    87          description: default
    88          schema:
    89            $ref: '#/definitions/notFound'
    90  /yet/again/some/where:
    91    get:
    92      responses:
    93        default:
    94          description: default
    95          schema:
    96            $ref: 'transitive-1.yaml#/somewhere'
    97  /with/slice/container:
    98    get:
    99      responses:
   100        default:
   101          description: default
   102          schema:
   103            allOf:
   104            - $ref: '#/definitions/uniqueName3'
   105            - $ref: 'transitive-1.yaml#/definitions/uniqueName3'
   106  /with/tuple/container:
   107    get:
   108      responses:
   109        default:
   110          description: default
   111          schema:
   112            type: array
   113            items:
   114            - $ref: '#/definitions/uniqueName3'
   115            - $ref: 'transitive-1.yaml#/definitions/uniqueName3'
   116  /with/tuple/conflict:
   117    get:
   118      responses:
   119        default:
   120          description: default
   121          schema:
   122            type: array
   123            items:
   124            - $ref: 'transitive-1.yaml#/definitions/uniqueName4'
   125            - $ref: 'transitive-2.yaml#/definitions/uniqueName4'
   126  /with/boolable/container:
   127    get:
   128      responses:
   129        default:
   130          description: default
   131          schema:
   132            type: object
   133            additionalProperties:
   134              $ref: 'transitive-1.yaml#/definitions/uniqueName5'
   135definitions:
   136  myDefaultResponse:
   137    type: object
   138    properties:
   139      zzz:
   140        type: integer
   141  myBody:
   142    type: object
   143    properties: 
   144      prop1: 
   145        type: integer
   146      aA:
   147        $ref: '#/definitions/aA'
   148  aA:
   149    type: string
   150    format: date
   151  bB:
   152    type: string
   153    format: date-time
   154  myResponse:
   155    type: object
   156    properties: 
   157      prop2: 
   158        type: integer
   159  notFound:
   160    type: array
   161    items:
   162      type: integer
   163  uniqueName1:
   164    # expect this to be expanded after OAIGen stripping
   165    $ref: 'transitive-1.yaml#/definitions/uniqueName1'
   166  notUniqueName2:
   167    # this one prevents OAIGen stripping
   168    $ref: 'transitive-1.yaml#/definitions/uniqueName2'
   169  uniqueName2:
   170    $ref: 'transitive-1.yaml#/definitions/uniqueName2'
   171  uniqueName3:
   172    type: object
   173    properties:
   174      prop7:
   175        type: integer
   176  uniqueName5:
   177    type: object
   178    properties:
   179      prop10:
   180        type: integer

View as plain text