File: fixture-oaigen.yaml

package info (click to toggle)
golang-github-go-openapi-analysis 0.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,548 kB
  • sloc: makefile: 4
file content (180 lines) | stat: -rw-r--r-- 4,234 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
---
swagger: '2.0'
info:
  version: '0.1.0'
  title: reference analysis

parameters:
  someParam:
    name: some
    in: query
    type: string
  bodyParam:
    name: some
    in: body
    schema:
      # expect this $ref to be kept
      $ref: '#/definitions/myBody'

responses:
  notFound:
    description: 'Not Found'
    schema:
      $ref: '#/definitions/notFound'

paths:
  /some/where:
    parameters:
    - $ref: '#/parameters/someParam'
    get:
      parameters:
      - $ref: '#/parameters/bodyParam' 
      - name: other
        in: query
        type: string
      responses:
        default:
          $ref: '#/responses/notFound'
        404:
          description: ok
          schema:
            $ref: '#/definitions/myResponse'
        304:
          description: ok
          schema:
            $ref: 'transitive-1.yaml#/definitions/transitive-1.1'
        204:
          description: ok
          schema:
            $ref: '#/definitions/uniqueName1'
        200:
          description: 'RecordHolder'
          schema:
            type: object
            properties:
              prop0:
                $ref: '#/definitions/myBody'
        206:
          description: ok
          schema:
            $ref: 'transitive-1.yaml#/definitions/a'
        205:
          description: ok
          schema:
            $ref: 'transitive-1.yaml#/definitions/b'
    # arbitrary json pointers
    post:
      responses:
        200:
          description: ok
          schema:
            # this one gets resolved
            $ref: 'transitive-2.yaml#/definitions/a/properties/b'
        204:
          description: ok
          schema:
            # this one gets resolved
            $ref: 'transitive-1.yaml#/definitions/c/properties/d'
        default:
          description: default
          schema:
            # this one remains (same file)
            $ref: '#/definitions/myDefaultResponse/properties/zzz'
  /some/where/else:
    get:
      responses:
        default:
          description: default
          schema:
            $ref: '#/definitions/notFound'
  /yet/again/some/where:
    get:
      responses:
        default:
          description: default
          schema:
            $ref: 'transitive-1.yaml#/somewhere'
  /with/slice/container:
    get:
      responses:
        default:
          description: default
          schema:
            allOf:
            - $ref: '#/definitions/uniqueName3'
            - $ref: 'transitive-1.yaml#/definitions/uniqueName3'
  /with/tuple/container:
    get:
      responses:
        default:
          description: default
          schema:
            type: array
            items:
            - $ref: '#/definitions/uniqueName3'
            - $ref: 'transitive-1.yaml#/definitions/uniqueName3'
  /with/tuple/conflict:
    get:
      responses:
        default:
          description: default
          schema:
            type: array
            items:
            - $ref: 'transitive-1.yaml#/definitions/uniqueName4'
            - $ref: 'transitive-2.yaml#/definitions/uniqueName4'
  /with/boolable/container:
    get:
      responses:
        default:
          description: default
          schema:
            type: object
            additionalProperties:
              $ref: 'transitive-1.yaml#/definitions/uniqueName5'
definitions:
  myDefaultResponse:
    type: object
    properties:
      zzz:
        type: integer
  myBody:
    type: object
    properties: 
      prop1: 
        type: integer
      aA:
        $ref: '#/definitions/aA'
  aA:
    type: string
    format: date
  bB:
    type: string
    format: date-time
  myResponse:
    type: object
    properties: 
      prop2: 
        type: integer
  notFound:
    type: array
    items:
      type: integer
  uniqueName1:
    # expect this to be expanded after OAIGen stripping
    $ref: 'transitive-1.yaml#/definitions/uniqueName1'
  notUniqueName2:
    # this one prevents OAIGen stripping
    $ref: 'transitive-1.yaml#/definitions/uniqueName2'
  uniqueName2:
    $ref: 'transitive-1.yaml#/definitions/uniqueName2'
  uniqueName3:
    type: object
    properties:
      prop7:
        type: integer
  uniqueName5:
    type: object
    properties:
      prop10:
        type: integer