api-render-ui 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,66 +8,93 @@
8
8
  </head>
9
9
 
10
10
  <body style="font-size: 75%;">
11
- <div id="notebook" style="overflow-y: auto;align-self: stretch;align-items: center;flex: 1 1 0;"></div>
11
+ <h3>Light theme</h3>
12
+ <div id="notebook-light" style="overflow-y: auto;align-self: stretch;align-items: center;flex: 1 1 0;margin-bottom:1rem;"></div>
13
+ <h3>Dark theme</h3>
14
+ <div id="notebook-dark" style="overflow-y: auto;align-self: stretch;align-items: center;flex: 1 1 0;margin-bottom:1rem;"></div>
15
+ <h3>Custom palette</h3>
16
+ <div id="notebook-custom" style="overflow-y: auto;align-self: stretch;align-items: center;flex: 1 1 0;margin-bottom:1rem;"></div>
12
17
  <script type="module">
13
18
  import { ApiRenderer } from "../dist/index.js"
14
19
  const openapiSpec = {
15
- "openapi": "3.0.3",
16
- "info": {
17
- "title": "Swagger Petstore - OpenAPI 3.0",
18
- "description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)",
19
- "termsOfService": "http://swagger.io/terms/",
20
- "contact": {
21
- "email": "apiteam@swagger.io"
22
- },
23
- "license": {
24
- "name": "Apache 2.0",
25
- "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
26
- },
27
- "version": "1.0.11"
20
+ "openapi": "3.0.3",
21
+ "info": {
22
+ "title": "Swagger Petstore - OpenAPI 3.0",
23
+ "description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)",
24
+ "termsOfService": "http://swagger.io/terms/",
25
+ "contact": {
26
+ "email": "apiteam@swagger.io"
28
27
  },
29
- "externalDocs": {
30
- "description": "Find out more about Swagger",
31
- "url": "http://swagger.io"
28
+ "license": {
29
+ "name": "Apache 2.0",
30
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
32
31
  },
33
- "servers": [
34
- {
35
- "url": "https://petstore3.swagger.io/api/v3"
32
+ "version": "1.0.11"
33
+ },
34
+ "externalDocs": {
35
+ "description": "Find out more about Swagger",
36
+ "url": "http://swagger.io"
37
+ },
38
+ "servers": [
39
+ {
40
+ "url": "https://petstore3.swagger.io/api/v3"
41
+ }
42
+ ],
43
+ "tags": [
44
+ {
45
+ "name": "pet",
46
+ "description": "Everything about your Pets",
47
+ "externalDocs": {
48
+ "description": "Find out more",
49
+ "url": "http://swagger.io"
36
50
  }
37
- ],
38
- "tags": [
39
- {
40
- "name": "pet",
41
- "description": "Everything about your Pets",
42
- "externalDocs": {
43
- "description": "Find out more",
44
- "url": "http://swagger.io"
45
- }
46
- },
47
- {
48
- "name": "store",
49
- "description": "Access to Petstore orders",
50
- "externalDocs": {
51
- "description": "Find out more about our store",
52
- "url": "http://swagger.io"
53
- }
54
- },
55
- {
56
- "name": "user",
57
- "description": "Operations about user"
51
+ },
52
+ {
53
+ "name": "store",
54
+ "description": "Access to Petstore orders",
55
+ "externalDocs": {
56
+ "description": "Find out more about our store",
57
+ "url": "http://swagger.io"
58
58
  }
59
- ],
60
- "paths": {
61
- "/pet": {
62
- "put": {
63
- "tags": [
64
- "pet"
65
- ],
66
- "summary": "Update an existing pet",
67
- "description": "Update an existing pet by Id",
68
- "operationId": "updatePet",
69
- "requestBody": {
70
- "description": "Update an existent pet in the store",
59
+ },
60
+ {
61
+ "name": "user",
62
+ "description": "Operations about user"
63
+ }
64
+ ],
65
+ "paths": {
66
+ "/pet": {
67
+ "put": {
68
+ "tags": [
69
+ "pet"
70
+ ],
71
+ "summary": "Update an existing pet",
72
+ "description": "Update an existing pet by Id",
73
+ "operationId": "updatePet",
74
+ "requestBody": {
75
+ "description": "Update an existent pet in the store",
76
+ "content": {
77
+ "application/json": {
78
+ "schema": {
79
+ "$ref": "#/components/schemas/Pet"
80
+ }
81
+ },
82
+ "application/xml": {
83
+ "schema": {
84
+ "$ref": "#/components/schemas/Pet"
85
+ }
86
+ },
87
+ "application/x-www-form-urlencoded": {
88
+ "schema": {
89
+ "$ref": "#/components/schemas/Pet"
90
+ }
91
+ }
92
+ },
93
+ "required": true
94
+ },
95
+ "responses": {
96
+ "200": {
97
+ "description": "Successful operation",
71
98
  "content": {
72
99
  "application/json": {
73
100
  "schema": {
@@ -78,59 +105,59 @@
78
105
  "schema": {
79
106
  "$ref": "#/components/schemas/Pet"
80
107
  }
81
- },
82
- "application/x-www-form-urlencoded": {
83
- "schema": {
84
- "$ref": "#/components/schemas/Pet"
85
- }
86
108
  }
87
- },
88
- "required": true
109
+ }
89
110
  },
90
- "responses": {
91
- "200": {
92
- "description": "Successful operation",
93
- "content": {
94
- "application/json": {
95
- "schema": {
96
- "$ref": "#/components/schemas/Pet"
97
- }
98
- },
99
- "application/xml": {
100
- "schema": {
101
- "$ref": "#/components/schemas/Pet"
102
- }
103
- }
111
+ "400": {
112
+ "description": "Invalid ID supplied"
113
+ },
114
+ "404": {
115
+ "description": "Pet not found"
116
+ },
117
+ "422": {
118
+ "description": "Validation exception"
119
+ }
120
+ },
121
+ "security": [
122
+ {
123
+ "petstore_auth": [
124
+ "write:pets",
125
+ "read:pets"
126
+ ]
127
+ }
128
+ ]
129
+ },
130
+ "post": {
131
+ "tags": [
132
+ "pet"
133
+ ],
134
+ "summary": "Add a new pet to the store",
135
+ "description": "Add a new pet to the store",
136
+ "operationId": "addPet",
137
+ "requestBody": {
138
+ "description": "Create a new pet in the store",
139
+ "content": {
140
+ "application/json": {
141
+ "schema": {
142
+ "$ref": "#/components/schemas/Pet"
104
143
  }
105
144
  },
106
- "400": {
107
- "description": "Invalid ID supplied"
108
- },
109
- "404": {
110
- "description": "Pet not found"
145
+ "application/xml": {
146
+ "schema": {
147
+ "$ref": "#/components/schemas/Pet"
148
+ }
111
149
  },
112
- "422": {
113
- "description": "Validation exception"
150
+ "application/x-www-form-urlencoded": {
151
+ "schema": {
152
+ "$ref": "#/components/schemas/Pet"
153
+ }
114
154
  }
115
155
  },
116
- "security": [
117
- {
118
- "petstore_auth": [
119
- "write:pets",
120
- "read:pets"
121
- ]
122
- }
123
- ]
156
+ "required": true
124
157
  },
125
- "post": {
126
- "tags": [
127
- "pet"
128
- ],
129
- "summary": "Add a new pet to the store",
130
- "description": "Add a new pet to the store",
131
- "operationId": "addPet",
132
- "requestBody": {
133
- "description": "Create a new pet in the store",
158
+ "responses": {
159
+ "200": {
160
+ "description": "Successful operation",
134
161
  "content": {
135
162
  "application/json": {
136
163
  "schema": {
@@ -141,417 +168,456 @@
141
168
  "schema": {
142
169
  "$ref": "#/components/schemas/Pet"
143
170
  }
144
- },
145
- "application/x-www-form-urlencoded": {
146
- "schema": {
147
- "$ref": "#/components/schemas/Pet"
148
- }
149
171
  }
150
- },
151
- "required": true
172
+ }
173
+ },
174
+ "400": {
175
+ "description": "Invalid input"
152
176
  },
153
- "responses": {
154
- "200": {
155
- "description": "Successful operation",
156
- "content": {
157
- "application/json": {
158
- "schema": {
177
+ "422": {
178
+ "description": "Validation exception"
179
+ }
180
+ },
181
+ "security": [
182
+ {
183
+ "petstore_auth": [
184
+ "write:pets",
185
+ "read:pets"
186
+ ]
187
+ }
188
+ ]
189
+ }
190
+ },
191
+ "/pet/findByStatus": {
192
+ "get": {
193
+ "tags": [
194
+ "pet"
195
+ ],
196
+ "summary": "Finds Pets by status",
197
+ "description": "Multiple status values can be provided with comma separated strings",
198
+ "operationId": "findPetsByStatus",
199
+ "parameters": [
200
+ {
201
+ "name": "status",
202
+ "in": "query",
203
+ "description": "Status values that need to be considered for filter",
204
+ "required": false,
205
+ "explode": true,
206
+ "schema": {
207
+ "type": "string",
208
+ "default": "available",
209
+ "enum": [
210
+ "available",
211
+ "pending",
212
+ "sold"
213
+ ]
214
+ }
215
+ }
216
+ ],
217
+ "responses": {
218
+ "200": {
219
+ "description": "successful operation",
220
+ "content": {
221
+ "application/json": {
222
+ "schema": {
223
+ "type": "array",
224
+ "items": {
159
225
  "$ref": "#/components/schemas/Pet"
160
226
  }
161
- },
162
- "application/xml": {
163
- "schema": {
227
+ }
228
+ },
229
+ "application/xml": {
230
+ "schema": {
231
+ "type": "array",
232
+ "items": {
164
233
  "$ref": "#/components/schemas/Pet"
165
234
  }
166
235
  }
167
236
  }
168
- },
169
- "400": {
170
- "description": "Invalid input"
171
- },
172
- "422": {
173
- "description": "Validation exception"
174
237
  }
175
238
  },
176
- "security": [
177
- {
178
- "petstore_auth": [
179
- "write:pets",
180
- "read:pets"
181
- ]
182
- }
183
- ]
184
- }
185
- },
186
- "/pet/findByStatus": {
187
- "get": {
188
- "tags": [
189
- "pet"
190
- ],
191
- "summary": "Finds Pets by status",
192
- "description": "Multiple status values can be provided with comma separated strings",
193
- "operationId": "findPetsByStatus",
194
- "parameters": [
195
- {
196
- "name": "status",
197
- "in": "query",
198
- "description": "Status values that need to be considered for filter",
199
- "required": false,
200
- "explode": true,
201
- "schema": {
202
- "type": "string",
203
- "default": "available",
204
- "enum": [
205
- "available",
206
- "pending",
207
- "sold"
208
- ]
239
+ "400": {
240
+ "description": "Invalid status value"
241
+ }
242
+ },
243
+ "security": [
244
+ {
245
+ "petstore_auth": [
246
+ "write:pets",
247
+ "read:pets"
248
+ ]
249
+ }
250
+ ]
251
+ }
252
+ },
253
+ "/pet/findByTags": {
254
+ "get": {
255
+ "tags": [
256
+ "pet"
257
+ ],
258
+ "summary": "Finds Pets by tags",
259
+ "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
260
+ "operationId": "findPetsByTags",
261
+ "parameters": [
262
+ {
263
+ "name": "tags",
264
+ "in": "query",
265
+ "description": "Tags to filter by",
266
+ "required": false,
267
+ "explode": true,
268
+ "schema": {
269
+ "type": "array",
270
+ "items": {
271
+ "type": "string"
209
272
  }
210
273
  }
211
- ],
212
- "responses": {
213
- "200": {
214
- "description": "successful operation",
215
- "content": {
216
- "application/json": {
217
- "schema": {
218
- "type": "array",
219
- "items": {
220
- "$ref": "#/components/schemas/Pet"
221
- }
274
+ }
275
+ ],
276
+ "responses": {
277
+ "200": {
278
+ "description": "successful operation",
279
+ "content": {
280
+ "application/json": {
281
+ "schema": {
282
+ "type": "array",
283
+ "items": {
284
+ "$ref": "#/components/schemas/Pet"
222
285
  }
223
- },
224
- "application/xml": {
225
- "schema": {
226
- "type": "array",
227
- "items": {
228
- "$ref": "#/components/schemas/Pet"
229
- }
286
+ }
287
+ },
288
+ "application/xml": {
289
+ "schema": {
290
+ "type": "array",
291
+ "items": {
292
+ "$ref": "#/components/schemas/Pet"
230
293
  }
231
294
  }
232
295
  }
233
- },
234
- "400": {
235
- "description": "Invalid status value"
236
296
  }
237
297
  },
238
- "security": [
239
- {
240
- "petstore_auth": [
241
- "write:pets",
242
- "read:pets"
243
- ]
298
+ "400": {
299
+ "description": "Invalid tag value"
300
+ }
301
+ },
302
+ "security": [
303
+ {
304
+ "petstore_auth": [
305
+ "write:pets",
306
+ "read:pets"
307
+ ]
308
+ }
309
+ ]
310
+ }
311
+ },
312
+ "/pet/{petId}": {
313
+ "get": {
314
+ "tags": [
315
+ "pet"
316
+ ],
317
+ "summary": "Find pet by ID",
318
+ "description": "Returns a single pet",
319
+ "operationId": "getPetById",
320
+ "parameters": [
321
+ {
322
+ "name": "petId",
323
+ "in": "path",
324
+ "description": "ID of pet to return",
325
+ "required": true,
326
+ "schema": {
327
+ "type": "integer",
328
+ "format": "int64"
244
329
  }
245
- ]
246
- }
247
- },
248
- "/pet/findByTags": {
249
- "get": {
250
- "tags": [
251
- "pet"
252
- ],
253
- "summary": "Finds Pets by tags",
254
- "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
255
- "operationId": "findPetsByTags",
256
- "parameters": [
257
- {
258
- "name": "tags",
259
- "in": "query",
260
- "description": "Tags to filter by",
261
- "required": false,
262
- "explode": true,
263
- "schema": {
264
- "type": "array",
265
- "items": {
266
- "type": "string"
330
+ }
331
+ ],
332
+ "responses": {
333
+ "200": {
334
+ "description": "successful operation",
335
+ "content": {
336
+ "application/json": {
337
+ "schema": {
338
+ "$ref": "#/components/schemas/Pet"
267
339
  }
268
- }
269
- }
270
- ],
271
- "responses": {
272
- "200": {
273
- "description": "successful operation",
274
- "content": {
275
- "application/json": {
276
- "schema": {
277
- "type": "array",
278
- "items": {
279
- "$ref": "#/components/schemas/Pet"
280
- }
281
- }
282
- },
283
- "application/xml": {
284
- "schema": {
285
- "type": "array",
286
- "items": {
287
- "$ref": "#/components/schemas/Pet"
288
- }
289
- }
340
+ },
341
+ "application/xml": {
342
+ "schema": {
343
+ "$ref": "#/components/schemas/Pet"
290
344
  }
291
345
  }
292
- },
293
- "400": {
294
- "description": "Invalid tag value"
295
346
  }
296
347
  },
297
- "security": [
298
- {
299
- "petstore_auth": [
300
- "write:pets",
301
- "read:pets"
302
- ]
303
- }
304
- ]
305
- }
348
+ "400": {
349
+ "description": "Invalid ID supplied"
350
+ },
351
+ "404": {
352
+ "description": "Pet not found"
353
+ }
354
+ },
355
+ "security": [
356
+ {
357
+ "api_key": []
358
+ },
359
+ {
360
+ "petstore_auth": [
361
+ "write:pets",
362
+ "read:pets"
363
+ ]
364
+ }
365
+ ]
306
366
  },
307
- "/pet/{petId}": {
308
- "get": {
309
- "tags": [
310
- "pet"
311
- ],
312
- "summary": "Find pet by ID",
313
- "description": "Returns a single pet",
314
- "operationId": "getPetById",
315
- "parameters": [
316
- {
317
- "name": "petId",
318
- "in": "path",
319
- "description": "ID of pet to return",
320
- "required": true,
321
- "schema": {
322
- "type": "integer",
323
- "format": "int64"
324
- }
367
+ "post": {
368
+ "tags": [
369
+ "pet"
370
+ ],
371
+ "summary": "Updates a pet in the store with form data",
372
+ "description": "",
373
+ "operationId": "updatePetWithForm",
374
+ "parameters": [
375
+ {
376
+ "name": "petId",
377
+ "in": "path",
378
+ "description": "ID of pet that needs to be updated",
379
+ "required": true,
380
+ "schema": {
381
+ "type": "integer",
382
+ "format": "int64"
325
383
  }
326
- ],
327
- "responses": {
328
- "200": {
329
- "description": "successful operation",
330
- "content": {
331
- "application/json": {
332
- "schema": {
333
- "$ref": "#/components/schemas/Pet"
334
- }
335
- },
336
- "application/xml": {
337
- "schema": {
338
- "$ref": "#/components/schemas/Pet"
339
- }
340
- }
341
- }
342
- },
343
- "400": {
344
- "description": "Invalid ID supplied"
345
- },
346
- "404": {
347
- "description": "Pet not found"
384
+ },
385
+ {
386
+ "name": "name",
387
+ "in": "query",
388
+ "description": "Name of pet that needs to be updated",
389
+ "schema": {
390
+ "type": "string"
348
391
  }
349
392
  },
350
- "security": [
351
- {
352
- "api_key": []
353
- },
354
- {
355
- "petstore_auth": [
356
- "write:pets",
357
- "read:pets"
358
- ]
393
+ {
394
+ "name": "status",
395
+ "in": "query",
396
+ "description": "Status of pet that needs to be updated",
397
+ "schema": {
398
+ "type": "string"
359
399
  }
360
- ]
400
+ }
401
+ ],
402
+ "responses": {
403
+ "400": {
404
+ "description": "Invalid input"
405
+ }
361
406
  },
362
- "post": {
363
- "tags": [
364
- "pet"
365
- ],
366
- "summary": "Updates a pet in the store with form data",
367
- "description": "",
368
- "operationId": "updatePetWithForm",
369
- "parameters": [
370
- {
371
- "name": "petId",
372
- "in": "path",
373
- "description": "ID of pet that needs to be updated",
374
- "required": true,
375
- "schema": {
376
- "type": "integer",
377
- "format": "int64"
378
- }
379
- },
380
- {
381
- "name": "name",
382
- "in": "query",
383
- "description": "Name of pet that needs to be updated",
384
- "schema": {
385
- "type": "string"
386
- }
387
- },
388
- {
389
- "name": "status",
390
- "in": "query",
391
- "description": "Status of pet that needs to be updated",
392
- "schema": {
393
- "type": "string"
394
- }
395
- }
396
- ],
397
- "responses": {
398
- "400": {
399
- "description": "Invalid input"
407
+ "security": [
408
+ {
409
+ "petstore_auth": [
410
+ "write:pets",
411
+ "read:pets"
412
+ ]
413
+ }
414
+ ]
415
+ },
416
+ "delete": {
417
+ "tags": [
418
+ "pet"
419
+ ],
420
+ "summary": "Deletes a pet",
421
+ "description": "delete a pet",
422
+ "operationId": "deletePet",
423
+ "parameters": [
424
+ {
425
+ "name": "api_key",
426
+ "in": "header",
427
+ "description": "",
428
+ "required": false,
429
+ "schema": {
430
+ "type": "string"
400
431
  }
401
432
  },
402
- "security": [
403
- {
404
- "petstore_auth": [
405
- "write:pets",
406
- "read:pets"
407
- ]
433
+ {
434
+ "name": "petId",
435
+ "in": "path",
436
+ "description": "Pet id to delete",
437
+ "required": true,
438
+ "schema": {
439
+ "type": "integer",
440
+ "format": "int64"
408
441
  }
409
- ]
442
+ }
443
+ ],
444
+ "responses": {
445
+ "400": {
446
+ "description": "Invalid pet value"
447
+ }
410
448
  },
411
- "delete": {
412
- "tags": [
413
- "pet"
414
- ],
415
- "summary": "Deletes a pet",
416
- "description": "delete a pet",
417
- "operationId": "deletePet",
418
- "parameters": [
419
- {
420
- "name": "api_key",
421
- "in": "header",
422
- "description": "",
423
- "required": false,
424
- "schema": {
425
- "type": "string"
426
- }
427
- },
428
- {
429
- "name": "petId",
430
- "in": "path",
431
- "description": "Pet id to delete",
432
- "required": true,
433
- "schema": {
434
- "type": "integer",
435
- "format": "int64"
436
- }
437
- }
438
- ],
439
- "responses": {
440
- "400": {
441
- "description": "Invalid pet value"
449
+ "security": [
450
+ {
451
+ "petstore_auth": [
452
+ "write:pets",
453
+ "read:pets"
454
+ ]
455
+ }
456
+ ]
457
+ }
458
+ },
459
+ "/pet/{petId}/uploadImage": {
460
+ "post": {
461
+ "tags": [
462
+ "pet"
463
+ ],
464
+ "summary": "uploads an image",
465
+ "description": "",
466
+ "operationId": "uploadFile",
467
+ "parameters": [
468
+ {
469
+ "name": "petId",
470
+ "in": "path",
471
+ "description": "ID of pet to update",
472
+ "required": true,
473
+ "schema": {
474
+ "type": "integer",
475
+ "format": "int64"
442
476
  }
443
477
  },
444
- "security": [
445
- {
446
- "petstore_auth": [
447
- "write:pets",
448
- "read:pets"
449
- ]
478
+ {
479
+ "name": "additionalMetadata",
480
+ "in": "query",
481
+ "description": "Additional Metadata",
482
+ "required": false,
483
+ "schema": {
484
+ "type": "string"
450
485
  }
451
- ]
452
- }
453
- },
454
- "/pet/{petId}/uploadImage": {
455
- "post": {
456
- "tags": [
457
- "pet"
458
- ],
459
- "summary": "uploads an image",
460
- "description": "",
461
- "operationId": "uploadFile",
462
- "parameters": [
463
- {
464
- "name": "petId",
465
- "in": "path",
466
- "description": "ID of pet to update",
467
- "required": true,
468
- "schema": {
469
- "type": "integer",
470
- "format": "int64"
471
- }
472
- },
473
- {
474
- "name": "additionalMetadata",
475
- "in": "query",
476
- "description": "Additional Metadata",
477
- "required": false,
486
+ }
487
+ ],
488
+ "requestBody": {
489
+ "content": {
490
+ "application/octet-stream": {
478
491
  "schema": {
479
- "type": "string"
492
+ "type": "string",
493
+ "format": "binary"
480
494
  }
481
495
  }
482
- ],
483
- "requestBody": {
496
+ }
497
+ },
498
+ "responses": {
499
+ "200": {
500
+ "description": "successful operation",
484
501
  "content": {
485
- "application/octet-stream": {
502
+ "application/json": {
486
503
  "schema": {
487
- "type": "string",
488
- "format": "binary"
504
+ "$ref": "#/components/schemas/ApiResponse"
489
505
  }
490
506
  }
491
507
  }
492
- },
493
- "responses": {
494
- "200": {
495
- "description": "successful operation",
496
- "content": {
497
- "application/json": {
498
- "schema": {
499
- "$ref": "#/components/schemas/ApiResponse"
508
+ }
509
+ },
510
+ "security": [
511
+ {
512
+ "petstore_auth": [
513
+ "write:pets",
514
+ "read:pets"
515
+ ]
516
+ }
517
+ ]
518
+ }
519
+ },
520
+ "/store/inventory": {
521
+ "get": {
522
+ "tags": [
523
+ "store"
524
+ ],
525
+ "summary": "Returns pet inventories by status",
526
+ "description": "Returns a map of status codes to quantities",
527
+ "operationId": "getInventory",
528
+ "responses": {
529
+ "200": {
530
+ "description": "successful operation",
531
+ "content": {
532
+ "application/json": {
533
+ "schema": {
534
+ "type": "object",
535
+ "additionalProperties": {
536
+ "type": "integer",
537
+ "format": "int32"
500
538
  }
501
539
  }
502
540
  }
503
541
  }
504
- },
505
- "security": [
506
- {
507
- "petstore_auth": [
508
- "write:pets",
509
- "read:pets"
510
- ]
542
+ }
543
+ },
544
+ "security": [
545
+ {
546
+ "api_key": []
547
+ }
548
+ ]
549
+ }
550
+ },
551
+ "/store/order": {
552
+ "post": {
553
+ "tags": [
554
+ "store"
555
+ ],
556
+ "summary": "Place an order for a pet",
557
+ "description": "Place a new order in the store",
558
+ "operationId": "placeOrder",
559
+ "requestBody": {
560
+ "content": {
561
+ "application/json": {
562
+ "schema": {
563
+ "$ref": "#/components/schemas/Order"
564
+ }
565
+ },
566
+ "application/xml": {
567
+ "schema": {
568
+ "$ref": "#/components/schemas/Order"
569
+ }
570
+ },
571
+ "application/x-www-form-urlencoded": {
572
+ "schema": {
573
+ "$ref": "#/components/schemas/Order"
574
+ }
511
575
  }
512
- ]
513
- }
514
- },
515
- "/store/inventory": {
516
- "get": {
517
- "tags": [
518
- "store"
519
- ],
520
- "summary": "Returns pet inventories by status",
521
- "description": "Returns a map of status codes to quantities",
522
- "operationId": "getInventory",
523
- "responses": {
524
- "200": {
525
- "description": "successful operation",
526
- "content": {
527
- "application/json": {
528
- "schema": {
529
- "type": "object",
530
- "additionalProperties": {
531
- "type": "integer",
532
- "format": "int32"
533
- }
534
- }
576
+ }
577
+ },
578
+ "responses": {
579
+ "200": {
580
+ "description": "successful operation",
581
+ "content": {
582
+ "application/json": {
583
+ "schema": {
584
+ "$ref": "#/components/schemas/Order"
535
585
  }
536
586
  }
537
587
  }
538
588
  },
539
- "security": [
540
- {
541
- "api_key": []
542
- }
543
- ]
589
+ "400": {
590
+ "description": "Invalid input"
591
+ },
592
+ "422": {
593
+ "description": "Validation exception"
594
+ }
544
595
  }
545
- },
546
- "/store/order": {
547
- "post": {
548
- "tags": [
549
- "store"
550
- ],
551
- "summary": "Place an order for a pet",
552
- "description": "Place a new order in the store",
553
- "operationId": "placeOrder",
554
- "requestBody": {
596
+ }
597
+ },
598
+ "/store/order/{orderId}": {
599
+ "get": {
600
+ "tags": [
601
+ "store"
602
+ ],
603
+ "summary": "Find purchase order by ID",
604
+ "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",
605
+ "operationId": "getOrderById",
606
+ "parameters": [
607
+ {
608
+ "name": "orderId",
609
+ "in": "path",
610
+ "description": "ID of order that needs to be fetched",
611
+ "required": true,
612
+ "schema": {
613
+ "type": "integer",
614
+ "format": "int64"
615
+ }
616
+ }
617
+ ],
618
+ "responses": {
619
+ "200": {
620
+ "description": "successful operation",
555
621
  "content": {
556
622
  "application/json": {
557
623
  "schema": {
@@ -562,117 +628,77 @@
562
628
  "schema": {
563
629
  "$ref": "#/components/schemas/Order"
564
630
  }
565
- },
566
- "application/x-www-form-urlencoded": {
567
- "schema": {
568
- "$ref": "#/components/schemas/Order"
569
- }
570
631
  }
571
632
  }
572
633
  },
573
- "responses": {
574
- "200": {
575
- "description": "successful operation",
576
- "content": {
577
- "application/json": {
578
- "schema": {
579
- "$ref": "#/components/schemas/Order"
580
- }
581
- }
582
- }
583
- },
584
- "400": {
585
- "description": "Invalid input"
586
- },
587
- "422": {
588
- "description": "Validation exception"
589
- }
634
+ "400": {
635
+ "description": "Invalid ID supplied"
636
+ },
637
+ "404": {
638
+ "description": "Order not found"
590
639
  }
591
640
  }
592
641
  },
593
- "/store/order/{orderId}": {
594
- "get": {
595
- "tags": [
596
- "store"
597
- ],
598
- "summary": "Find purchase order by ID",
599
- "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",
600
- "operationId": "getOrderById",
601
- "parameters": [
602
- {
603
- "name": "orderId",
604
- "in": "path",
605
- "description": "ID of order that needs to be fetched",
606
- "required": true,
607
- "schema": {
608
- "type": "integer",
609
- "format": "int64"
610
- }
642
+ "delete": {
643
+ "tags": [
644
+ "store"
645
+ ],
646
+ "summary": "Delete purchase order by ID",
647
+ "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
648
+ "operationId": "deleteOrder",
649
+ "parameters": [
650
+ {
651
+ "name": "orderId",
652
+ "in": "path",
653
+ "description": "ID of the order that needs to be deleted",
654
+ "required": true,
655
+ "schema": {
656
+ "type": "integer",
657
+ "format": "int64"
611
658
  }
612
- ],
613
- "responses": {
614
- "200": {
615
- "description": "successful operation",
616
- "content": {
617
- "application/json": {
618
- "schema": {
619
- "$ref": "#/components/schemas/Order"
620
- }
621
- },
622
- "application/xml": {
623
- "schema": {
624
- "$ref": "#/components/schemas/Order"
625
- }
626
- }
659
+ }
660
+ ],
661
+ "responses": {
662
+ "400": {
663
+ "description": "Invalid ID supplied"
664
+ },
665
+ "404": {
666
+ "description": "Order not found"
667
+ }
668
+ }
669
+ }
670
+ },
671
+ "/user": {
672
+ "post": {
673
+ "tags": [
674
+ "user"
675
+ ],
676
+ "summary": "Create user",
677
+ "description": "This can only be done by the logged in user.",
678
+ "operationId": "createUser",
679
+ "requestBody": {
680
+ "description": "Created user object",
681
+ "content": {
682
+ "application/json": {
683
+ "schema": {
684
+ "$ref": "#/components/schemas/User"
627
685
  }
628
686
  },
629
- "400": {
630
- "description": "Invalid ID supplied"
631
- },
632
- "404": {
633
- "description": "Order not found"
634
- }
635
- }
636
- },
637
- "delete": {
638
- "tags": [
639
- "store"
640
- ],
641
- "summary": "Delete purchase order by ID",
642
- "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
643
- "operationId": "deleteOrder",
644
- "parameters": [
645
- {
646
- "name": "orderId",
647
- "in": "path",
648
- "description": "ID of the order that needs to be deleted",
649
- "required": true,
687
+ "application/xml": {
650
688
  "schema": {
651
- "type": "integer",
652
- "format": "int64"
689
+ "$ref": "#/components/schemas/User"
653
690
  }
654
- }
655
- ],
656
- "responses": {
657
- "400": {
658
- "description": "Invalid ID supplied"
659
691
  },
660
- "404": {
661
- "description": "Order not found"
692
+ "application/x-www-form-urlencoded": {
693
+ "schema": {
694
+ "$ref": "#/components/schemas/User"
695
+ }
662
696
  }
663
697
  }
664
- }
665
- },
666
- "/user": {
667
- "post": {
668
- "tags": [
669
- "user"
670
- ],
671
- "summary": "Create user",
672
- "description": "This can only be done by the logged in user.",
673
- "operationId": "createUser",
674
- "requestBody": {
675
- "description": "Created user object",
698
+ },
699
+ "responses": {
700
+ "default": {
701
+ "description": "successful operation",
676
702
  "content": {
677
703
  "application/json": {
678
704
  "schema": {
@@ -683,220 +709,158 @@
683
709
  "schema": {
684
710
  "$ref": "#/components/schemas/User"
685
711
  }
686
- },
687
- "application/x-www-form-urlencoded": {
688
- "schema": {
689
- "$ref": "#/components/schemas/User"
690
- }
691
712
  }
692
713
  }
693
- },
694
- "responses": {
695
- "default": {
696
- "description": "successful operation",
697
- "content": {
698
- "application/json": {
699
- "schema": {
700
- "$ref": "#/components/schemas/User"
701
- }
702
- },
703
- "application/xml": {
704
- "schema": {
705
- "$ref": "#/components/schemas/User"
706
- }
714
+ }
715
+ }
716
+ }
717
+ },
718
+ "/user/createWithList": {
719
+ "post": {
720
+ "tags": [
721
+ "user"
722
+ ],
723
+ "summary": "Creates list of users with given input array",
724
+ "description": "Creates list of users with given input array",
725
+ "operationId": "createUsersWithListInput",
726
+ "requestBody": {
727
+ "content": {
728
+ "application/json": {
729
+ "schema": {
730
+ "type": "array",
731
+ "items": {
732
+ "$ref": "#/components/schemas/User"
707
733
  }
708
734
  }
709
735
  }
710
736
  }
711
- }
712
- },
713
- "/user/createWithList": {
714
- "post": {
715
- "tags": [
716
- "user"
717
- ],
718
- "summary": "Creates list of users with given input array",
719
- "description": "Creates list of users with given input array",
720
- "operationId": "createUsersWithListInput",
721
- "requestBody": {
737
+ },
738
+ "responses": {
739
+ "200": {
740
+ "description": "Successful operation",
722
741
  "content": {
723
742
  "application/json": {
724
743
  "schema": {
725
- "type": "array",
726
- "items": {
727
- "$ref": "#/components/schemas/User"
728
- }
744
+ "$ref": "#/components/schemas/User"
745
+ }
746
+ },
747
+ "application/xml": {
748
+ "schema": {
749
+ "$ref": "#/components/schemas/User"
729
750
  }
730
751
  }
731
752
  }
732
753
  },
733
- "responses": {
734
- "200": {
735
- "description": "Successful operation",
736
- "content": {
737
- "application/json": {
738
- "schema": {
739
- "$ref": "#/components/schemas/User"
740
- }
741
- },
742
- "application/xml": {
743
- "schema": {
744
- "$ref": "#/components/schemas/User"
745
- }
746
- }
747
- }
748
- },
749
- "default": {
750
- "description": "successful operation"
751
- }
754
+ "default": {
755
+ "description": "successful operation"
752
756
  }
753
757
  }
754
- },
755
- "/user/login": {
756
- "get": {
757
- "tags": [
758
- "user"
759
- ],
760
- "summary": "Logs user into the system",
761
- "description": "",
762
- "operationId": "loginUser",
763
- "parameters": [
764
- {
765
- "name": "username",
766
- "in": "query",
767
- "description": "The user name for login",
768
- "required": false,
769
- "schema": {
770
- "type": "string"
771
- }
772
- },
773
- {
774
- "name": "password",
775
- "in": "query",
776
- "description": "The password for login in clear text",
777
- "required": false,
778
- "schema": {
779
- "type": "string"
780
- }
758
+ }
759
+ },
760
+ "/user/login": {
761
+ "get": {
762
+ "tags": [
763
+ "user"
764
+ ],
765
+ "summary": "Logs user into the system",
766
+ "description": "",
767
+ "operationId": "loginUser",
768
+ "parameters": [
769
+ {
770
+ "name": "username",
771
+ "in": "query",
772
+ "description": "The user name for login",
773
+ "required": false,
774
+ "schema": {
775
+ "type": "string"
781
776
  }
782
- ],
783
- "responses": {
784
- "200": {
785
- "description": "successful operation",
786
- "headers": {
787
- "X-Rate-Limit": {
788
- "description": "calls per hour allowed by the user",
789
- "schema": {
790
- "type": "integer",
791
- "format": "int32"
792
- }
793
- },
794
- "X-Expires-After": {
795
- "description": "date in UTC when token expires",
796
- "schema": {
797
- "type": "string",
798
- "format": "date-time"
799
- }
777
+ },
778
+ {
779
+ "name": "password",
780
+ "in": "query",
781
+ "description": "The password for login in clear text",
782
+ "required": false,
783
+ "schema": {
784
+ "type": "string"
785
+ }
786
+ }
787
+ ],
788
+ "responses": {
789
+ "200": {
790
+ "description": "successful operation",
791
+ "headers": {
792
+ "X-Rate-Limit": {
793
+ "description": "calls per hour allowed by the user",
794
+ "schema": {
795
+ "type": "integer",
796
+ "format": "int32"
800
797
  }
801
798
  },
802
- "content": {
803
- "application/xml": {
804
- "schema": {
805
- "type": "string"
806
- }
807
- },
808
- "application/json": {
809
- "schema": {
810
- "type": "string"
811
- }
799
+ "X-Expires-After": {
800
+ "description": "date in UTC when token expires",
801
+ "schema": {
802
+ "type": "string",
803
+ "format": "date-time"
812
804
  }
813
805
  }
814
806
  },
815
- "400": {
816
- "description": "Invalid username/password supplied"
807
+ "content": {
808
+ "application/xml": {
809
+ "schema": {
810
+ "type": "string"
811
+ }
812
+ },
813
+ "application/json": {
814
+ "schema": {
815
+ "type": "string"
816
+ }
817
+ }
817
818
  }
819
+ },
820
+ "400": {
821
+ "description": "Invalid username/password supplied"
818
822
  }
819
823
  }
820
- },
821
- "/user/logout": {
822
- "get": {
823
- "tags": [
824
- "user"
825
- ],
826
- "summary": "Logs out current logged in user session",
827
- "description": "",
828
- "operationId": "logoutUser",
829
- "parameters": [],
830
- "responses": {
831
- "default": {
832
- "description": "successful operation"
833
- }
824
+ }
825
+ },
826
+ "/user/logout": {
827
+ "get": {
828
+ "tags": [
829
+ "user"
830
+ ],
831
+ "summary": "Logs out current logged in user session",
832
+ "description": "",
833
+ "operationId": "logoutUser",
834
+ "parameters": [],
835
+ "responses": {
836
+ "default": {
837
+ "description": "successful operation"
834
838
  }
835
839
  }
836
- },
837
- "/user/{username}": {
838
- "get": {
839
- "tags": [
840
- "user"
841
- ],
842
- "summary": "Get user by user name",
843
- "description": "",
844
- "operationId": "getUserByName",
845
- "parameters": [
846
- {
847
- "name": "username",
848
- "in": "path",
849
- "description": "The name that needs to be fetched. Use user1 for testing. ",
850
- "required": true,
851
- "schema": {
852
- "type": "string"
853
- }
854
- }
855
- ],
856
- "responses": {
857
- "200": {
858
- "description": "successful operation",
859
- "content": {
860
- "application/json": {
861
- "schema": {
862
- "$ref": "#/components/schemas/User"
863
- }
864
- },
865
- "application/xml": {
866
- "schema": {
867
- "$ref": "#/components/schemas/User"
868
- }
869
- }
870
- }
871
- },
872
- "400": {
873
- "description": "Invalid username supplied"
874
- },
875
- "404": {
876
- "description": "User not found"
840
+ }
841
+ },
842
+ "/user/{username}": {
843
+ "get": {
844
+ "tags": [
845
+ "user"
846
+ ],
847
+ "summary": "Get user by user name",
848
+ "description": "",
849
+ "operationId": "getUserByName",
850
+ "parameters": [
851
+ {
852
+ "name": "username",
853
+ "in": "path",
854
+ "description": "The name that needs to be fetched. Use user1 for testing. ",
855
+ "required": true,
856
+ "schema": {
857
+ "type": "string"
877
858
  }
878
859
  }
879
- },
880
- "put": {
881
- "tags": [
882
- "user"
883
- ],
884
- "summary": "Update user",
885
- "description": "This can only be done by the logged in user.",
886
- "operationId": "updateUser",
887
- "parameters": [
888
- {
889
- "name": "username",
890
- "in": "path",
891
- "description": "name that need to be deleted",
892
- "required": true,
893
- "schema": {
894
- "type": "string"
895
- }
896
- }
897
- ],
898
- "requestBody": {
899
- "description": "Update an existent user in the store",
860
+ ],
861
+ "responses": {
862
+ "200": {
863
+ "description": "successful operation",
900
864
  "content": {
901
865
  "application/json": {
902
866
  "schema": {
@@ -907,346 +871,444 @@
907
871
  "schema": {
908
872
  "$ref": "#/components/schemas/User"
909
873
  }
910
- },
911
- "application/x-www-form-urlencoded": {
912
- "schema": {
913
- "$ref": "#/components/schemas/User"
914
- }
915
874
  }
916
875
  }
917
876
  },
918
- "responses": {
919
- "default": {
920
- "description": "successful operation"
877
+ "400": {
878
+ "description": "Invalid username supplied"
879
+ },
880
+ "404": {
881
+ "description": "User not found"
882
+ }
883
+ }
884
+ },
885
+ "put": {
886
+ "tags": [
887
+ "user"
888
+ ],
889
+ "summary": "Update user",
890
+ "description": "This can only be done by the logged in user.",
891
+ "operationId": "updateUser",
892
+ "parameters": [
893
+ {
894
+ "name": "username",
895
+ "in": "path",
896
+ "description": "name that need to be deleted",
897
+ "required": true,
898
+ "schema": {
899
+ "type": "string"
921
900
  }
922
901
  }
923
- },
924
- "delete": {
925
- "tags": [
926
- "user"
927
- ],
928
- "summary": "Delete user",
929
- "description": "This can only be done by the logged in user.",
930
- "operationId": "deleteUser",
931
- "parameters": [
932
- {
933
- "name": "username",
934
- "in": "path",
935
- "description": "The name that needs to be deleted",
936
- "required": true,
902
+ ],
903
+ "requestBody": {
904
+ "description": "Update an existent user in the store",
905
+ "content": {
906
+ "application/json": {
937
907
  "schema": {
938
- "type": "string"
908
+ "$ref": "#/components/schemas/User"
939
909
  }
940
- }
941
- ],
942
- "responses": {
943
- "400": {
944
- "description": "Invalid username supplied"
945
910
  },
946
- "404": {
947
- "description": "User not found"
911
+ "application/xml": {
912
+ "schema": {
913
+ "$ref": "#/components/schemas/User"
914
+ }
915
+ },
916
+ "application/x-www-form-urlencoded": {
917
+ "schema": {
918
+ "$ref": "#/components/schemas/User"
919
+ }
948
920
  }
949
921
  }
922
+ },
923
+ "responses": {
924
+ "default": {
925
+ "description": "successful operation"
926
+ }
950
927
  }
951
- }
952
- },
953
- "components": {
954
- "schemas": {
955
- "Order": {
956
- "type": "object",
957
- "properties": {
958
- "id": {
959
- "type": "integer",
960
- "format": "int64",
961
- "example": 10
962
- },
963
- "petId": {
964
- "type": "integer",
965
- "format": "int64",
966
- "example": 198772
967
- },
968
- "quantity": {
969
- "type": "integer",
970
- "format": "int32",
971
- "example": 7
972
- },
973
- "shipDate": {
974
- "type": "string",
975
- "format": "date-time"
976
- },
977
- "status": {
978
- "type": "string",
979
- "description": "Order Status",
980
- "example": "approved",
981
- "enum": [
982
- "placed",
983
- "approved",
984
- "delivered"
985
- ]
986
- },
987
- "complete": {
988
- "type": "boolean"
928
+ },
929
+ "delete": {
930
+ "tags": [
931
+ "user"
932
+ ],
933
+ "summary": "Delete user",
934
+ "description": "This can only be done by the logged in user.",
935
+ "operationId": "deleteUser",
936
+ "parameters": [
937
+ {
938
+ "name": "username",
939
+ "in": "path",
940
+ "description": "The name that needs to be deleted",
941
+ "required": true,
942
+ "schema": {
943
+ "type": "string"
989
944
  }
945
+ }
946
+ ],
947
+ "responses": {
948
+ "400": {
949
+ "description": "Invalid username supplied"
990
950
  },
991
- "xml": {
992
- "name": "order"
951
+ "404": {
952
+ "description": "User not found"
993
953
  }
994
- },
995
- "Customer": {
996
- "type": "object",
997
- "properties": {
998
- "id": {
999
- "type": "integer",
1000
- "format": "int64",
1001
- "example": 100000
1002
- },
1003
- "username": {
1004
- "type": "string",
1005
- "example": "fehguy"
1006
- },
1007
- "address": {
1008
- "type": "array",
1009
- "xml": {
1010
- "name": "addresses",
1011
- "wrapped": true
1012
- },
1013
- "items": {
1014
- "$ref": "#/components/schemas/Address"
1015
- }
1016
- }
954
+ }
955
+ }
956
+ }
957
+ },
958
+ "components": {
959
+ "schemas": {
960
+ "Order": {
961
+ "type": "object",
962
+ "properties": {
963
+ "id": {
964
+ "type": "integer",
965
+ "format": "int64",
966
+ "example": 10
967
+ },
968
+ "petId": {
969
+ "type": "integer",
970
+ "format": "int64",
971
+ "example": 198772
1017
972
  },
1018
- "xml": {
1019
- "name": "customer"
973
+ "quantity": {
974
+ "type": "integer",
975
+ "format": "int32",
976
+ "example": 7
977
+ },
978
+ "shipDate": {
979
+ "type": "string",
980
+ "format": "date-time"
981
+ },
982
+ "status": {
983
+ "type": "string",
984
+ "description": "Order Status",
985
+ "example": "approved",
986
+ "enum": [
987
+ "placed",
988
+ "approved",
989
+ "delivered"
990
+ ]
991
+ },
992
+ "complete": {
993
+ "type": "boolean"
1020
994
  }
1021
995
  },
1022
- "Address": {
1023
- "type": "object",
1024
- "properties": {
1025
- "street": {
1026
- "type": "string",
1027
- "example": "437 Lytton"
1028
- },
1029
- "city": {
1030
- "type": "string",
1031
- "example": "Palo Alto"
1032
- },
1033
- "state": {
1034
- "type": "string",
1035
- "example": "CA"
996
+ "xml": {
997
+ "name": "order"
998
+ }
999
+ },
1000
+ "Customer": {
1001
+ "type": "object",
1002
+ "properties": {
1003
+ "id": {
1004
+ "type": "integer",
1005
+ "format": "int64",
1006
+ "example": 100000
1007
+ },
1008
+ "username": {
1009
+ "type": "string",
1010
+ "example": "fehguy"
1011
+ },
1012
+ "address": {
1013
+ "type": "array",
1014
+ "xml": {
1015
+ "name": "addresses",
1016
+ "wrapped": true
1036
1017
  },
1037
- "zip": {
1038
- "type": "string",
1039
- "example": "94301"
1018
+ "items": {
1019
+ "$ref": "#/components/schemas/Address"
1040
1020
  }
1021
+ }
1022
+ },
1023
+ "xml": {
1024
+ "name": "customer"
1025
+ }
1026
+ },
1027
+ "Address": {
1028
+ "type": "object",
1029
+ "properties": {
1030
+ "street": {
1031
+ "type": "string",
1032
+ "example": "437 Lytton"
1033
+ },
1034
+ "city": {
1035
+ "type": "string",
1036
+ "example": "Palo Alto"
1041
1037
  },
1042
- "xml": {
1043
- "name": "address"
1038
+ "state": {
1039
+ "type": "string",
1040
+ "example": "CA"
1041
+ },
1042
+ "zip": {
1043
+ "type": "string",
1044
+ "example": "94301"
1044
1045
  }
1045
1046
  },
1046
- "Category": {
1047
- "type": "object",
1048
- "properties": {
1049
- "id": {
1050
- "type": "integer",
1051
- "format": "int64",
1052
- "example": 1
1053
- },
1054
- "name": {
1055
- "type": "string",
1056
- "example": "Dogs"
1057
- }
1047
+ "xml": {
1048
+ "name": "address"
1049
+ }
1050
+ },
1051
+ "Category": {
1052
+ "type": "object",
1053
+ "properties": {
1054
+ "id": {
1055
+ "type": "integer",
1056
+ "format": "int64",
1057
+ "example": 1
1058
1058
  },
1059
- "xml": {
1060
- "name": "category"
1059
+ "name": {
1060
+ "type": "string",
1061
+ "example": "Dogs"
1061
1062
  }
1062
1063
  },
1063
- "User": {
1064
- "type": "object",
1065
- "properties": {
1066
- "id": {
1067
- "type": "integer",
1068
- "format": "int64",
1069
- "example": 10
1070
- },
1071
- "username": {
1072
- "type": "string",
1073
- "example": "theUser"
1074
- },
1075
- "firstName": {
1076
- "type": "string",
1077
- "example": "John"
1078
- },
1079
- "lastName": {
1080
- "type": "string",
1081
- "example": "James"
1082
- },
1083
- "email": {
1084
- "type": "string",
1085
- "example": "john@email.com"
1086
- },
1087
- "password": {
1088
- "type": "string",
1089
- "example": "12345"
1090
- },
1091
- "phone": {
1092
- "type": "string",
1093
- "example": "12345"
1094
- },
1095
- "userStatus": {
1096
- "type": "integer",
1097
- "description": "User Status",
1098
- "format": "int32",
1099
- "example": 1
1100
- }
1064
+ "xml": {
1065
+ "name": "category"
1066
+ }
1067
+ },
1068
+ "User": {
1069
+ "type": "object",
1070
+ "properties": {
1071
+ "id": {
1072
+ "type": "integer",
1073
+ "format": "int64",
1074
+ "example": 10
1075
+ },
1076
+ "username": {
1077
+ "type": "string",
1078
+ "example": "theUser"
1079
+ },
1080
+ "firstName": {
1081
+ "type": "string",
1082
+ "example": "John"
1083
+ },
1084
+ "lastName": {
1085
+ "type": "string",
1086
+ "example": "James"
1087
+ },
1088
+ "email": {
1089
+ "type": "string",
1090
+ "example": "john@email.com"
1091
+ },
1092
+ "password": {
1093
+ "type": "string",
1094
+ "example": "12345"
1101
1095
  },
1102
- "xml": {
1103
- "name": "user"
1096
+ "phone": {
1097
+ "type": "string",
1098
+ "example": "12345"
1099
+ },
1100
+ "userStatus": {
1101
+ "type": "integer",
1102
+ "description": "User Status",
1103
+ "format": "int32",
1104
+ "example": 1
1104
1105
  }
1105
1106
  },
1106
- "Tag": {
1107
- "type": "object",
1108
- "properties": {
1109
- "id": {
1110
- "type": "integer",
1111
- "format": "int64"
1112
- },
1113
- "name": {
1114
- "type": "string"
1115
- }
1107
+ "xml": {
1108
+ "name": "user"
1109
+ }
1110
+ },
1111
+ "Tag": {
1112
+ "type": "object",
1113
+ "properties": {
1114
+ "id": {
1115
+ "type": "integer",
1116
+ "format": "int64"
1116
1117
  },
1117
- "xml": {
1118
- "name": "tag"
1118
+ "name": {
1119
+ "type": "string"
1119
1120
  }
1120
1121
  },
1121
- "Pet": {
1122
- "required": [
1123
- "name",
1124
- "photoUrls"
1125
- ],
1126
- "type": "object",
1127
- "properties": {
1128
- "id": {
1129
- "type": "integer",
1130
- "format": "int64",
1131
- "example": 10
1122
+ "xml": {
1123
+ "name": "tag"
1124
+ }
1125
+ },
1126
+ "Pet": {
1127
+ "required": [
1128
+ "name",
1129
+ "photoUrls"
1130
+ ],
1131
+ "type": "object",
1132
+ "properties": {
1133
+ "id": {
1134
+ "type": "integer",
1135
+ "format": "int64",
1136
+ "example": 10
1137
+ },
1138
+ "name": {
1139
+ "type": "string",
1140
+ "example": "doggie"
1141
+ },
1142
+ "category": {
1143
+ "$ref": "#/components/schemas/Category"
1144
+ },
1145
+ "photoUrls": {
1146
+ "type": "array",
1147
+ "xml": {
1148
+ "wrapped": true
1132
1149
  },
1133
- "name": {
1150
+ "items": {
1134
1151
  "type": "string",
1135
- "example": "doggie"
1136
- },
1137
- "category": {
1138
- "$ref": "#/components/schemas/Category"
1139
- },
1140
- "photoUrls": {
1141
- "type": "array",
1142
- "xml": {
1143
- "wrapped": true
1144
- },
1145
- "items": {
1146
- "type": "string",
1147
- "xml": {
1148
- "name": "photoUrl"
1149
- }
1150
- }
1151
- },
1152
- "tags": {
1153
- "type": "array",
1154
1152
  "xml": {
1155
- "wrapped": true
1156
- },
1157
- "items": {
1158
- "$ref": "#/components/schemas/Tag"
1153
+ "name": "photoUrl"
1159
1154
  }
1160
- },
1161
- "status": {
1162
- "type": "string",
1163
- "description": "pet status in the store",
1164
- "enum": [
1165
- "available",
1166
- "pending",
1167
- "sold"
1168
- ]
1169
1155
  }
1170
1156
  },
1171
- "xml": {
1172
- "name": "pet"
1173
- }
1174
- },
1175
- "ApiResponse": {
1176
- "type": "object",
1177
- "properties": {
1178
- "code": {
1179
- "type": "integer",
1180
- "format": "int32"
1181
- },
1182
- "type": {
1183
- "type": "string"
1157
+ "tags": {
1158
+ "type": "array",
1159
+ "xml": {
1160
+ "wrapped": true
1184
1161
  },
1185
- "message": {
1186
- "type": "string"
1162
+ "items": {
1163
+ "$ref": "#/components/schemas/Tag"
1187
1164
  }
1188
1165
  },
1189
- "xml": {
1190
- "name": "##default"
1166
+ "status": {
1167
+ "type": "string",
1168
+ "description": "pet status in the store",
1169
+ "enum": [
1170
+ "available",
1171
+ "pending",
1172
+ "sold"
1173
+ ]
1191
1174
  }
1175
+ },
1176
+ "xml": {
1177
+ "name": "pet"
1192
1178
  }
1193
1179
  },
1194
- "requestBodies": {
1195
- "Pet": {
1196
- "description": "Pet object that needs to be added to the store",
1197
- "content": {
1198
- "application/json": {
1199
- "schema": {
1200
- "$ref": "#/components/schemas/Pet"
1201
- }
1202
- },
1203
- "application/xml": {
1204
- "schema": {
1205
- "$ref": "#/components/schemas/Pet"
1206
- }
1207
- }
1180
+ "ApiResponse": {
1181
+ "type": "object",
1182
+ "properties": {
1183
+ "code": {
1184
+ "type": "integer",
1185
+ "format": "int32"
1186
+ },
1187
+ "type": {
1188
+ "type": "string"
1189
+ },
1190
+ "message": {
1191
+ "type": "string"
1208
1192
  }
1209
1193
  },
1210
- "UserArray": {
1211
- "description": "List of user object",
1212
- "content": {
1213
- "application/json": {
1214
- "schema": {
1215
- "type": "array",
1216
- "items": {
1217
- "$ref": "#/components/schemas/User"
1218
- }
1219
- }
1194
+ "xml": {
1195
+ "name": "##default"
1196
+ }
1197
+ }
1198
+ },
1199
+ "requestBodies": {
1200
+ "Pet": {
1201
+ "description": "Pet object that needs to be added to the store",
1202
+ "content": {
1203
+ "application/json": {
1204
+ "schema": {
1205
+ "$ref": "#/components/schemas/Pet"
1206
+ }
1207
+ },
1208
+ "application/xml": {
1209
+ "schema": {
1210
+ "$ref": "#/components/schemas/Pet"
1220
1211
  }
1221
1212
  }
1222
1213
  }
1223
1214
  },
1224
- "securitySchemes": {
1225
- "petstore_auth": {
1226
- "type": "oauth2",
1227
- "flows": {
1228
- "implicit": {
1229
- "authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
1230
- "scopes": {
1231
- "write:pets": "modify pets in your account",
1232
- "read:pets": "read your pets"
1215
+ "UserArray": {
1216
+ "description": "List of user object",
1217
+ "content": {
1218
+ "application/json": {
1219
+ "schema": {
1220
+ "type": "array",
1221
+ "items": {
1222
+ "$ref": "#/components/schemas/User"
1233
1223
  }
1234
1224
  }
1235
1225
  }
1236
- },
1237
- "api_key": {
1238
- "type": "apiKey",
1239
- "name": "api_key",
1240
- "in": "header"
1241
1226
  }
1242
1227
  }
1228
+ },
1229
+ "securitySchemes": {
1230
+ "petstore_auth": {
1231
+ "type": "oauth2",
1232
+ "flows": {
1233
+ "implicit": {
1234
+ "authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
1235
+ "scopes": {
1236
+ "write:pets": "modify pets in your account",
1237
+ "read:pets": "read your pets"
1238
+ }
1239
+ }
1240
+ }
1241
+ },
1242
+ "api_key": {
1243
+ "type": "apiKey",
1244
+ "name": "api_key",
1245
+ "in": "header"
1246
+ }
1243
1247
  }
1244
1248
  }
1245
- const apiRenderer = new ApiRenderer({
1246
- mountPoint: '#notebook', // 可以是选择器字符串
1249
+ }
1250
+ // light theme
1251
+ const apiRendererLight = new ApiRenderer({
1252
+ mountPoint: '#notebook-light',
1253
+ theme: 'light'
1254
+ });
1255
+ apiRendererLight.render(openapiSpec);
1256
+
1257
+ // dark theme
1258
+ const apiRendererDark = new ApiRenderer({
1259
+ mountPoint: '#notebook-dark',
1260
+ theme: 'dark'
1261
+ });
1262
+ apiRendererDark.render(openapiSpec);
1263
+
1264
+ // custom palette (object accepts CSS var names or short keys like 'primary')
1265
+ const apiRendererCustom = new ApiRenderer({
1266
+ mountPoint: '#notebook-custom',
1267
+ theme: {
1268
+ main: '#ff7f50', // main / primary color
1269
+ aux: '#ffd1b3', // auxiliary color (hover/accents)
1270
+ embellish: '#ffc39e', // embellishment (active states)
1271
+ surface: '#fff8f0'
1272
+ }
1273
+ });
1274
+ apiRendererCustom.render(openapiSpec);
1275
+
1276
+ // Rainbow palette examples
1277
+ const rainbow = [
1278
+ { name: 'red', color: '#e53935' },
1279
+ { name: 'orange', color: '#fb8c00' },
1280
+ { name: 'yellow', color: '#fdd835' },
1281
+ { name: 'green', color: '#43a047' },
1282
+ { name: 'blue', color: '#1e88e5' },
1283
+ { name: 'indigo', color: '#3949ab' },
1284
+ { name: 'violet', color: '#8e24aa' }
1285
+ ];
1286
+
1287
+ rainbow.forEach(r => {
1288
+ // wrapper with title + mount point so title isn't removed by render()
1289
+ const wrapper = document.createElement('div');
1290
+ wrapper.style.marginBottom = '0.5rem';
1291
+
1292
+ const title = document.createElement('div');
1293
+ title.textContent = `Rainbow — ${r.name}`;
1294
+ title.style.fontWeight = '600';
1295
+ title.style.margin = '6px 0 6px 0';
1296
+ title.style.color = r.color; // title uses the color
1297
+ wrapper.appendChild(title);
1298
+
1299
+ const mount = document.createElement('div');
1300
+ mount.id = `notebook-rainbow-${r.name}`;
1301
+ mount.style.cssText = 'overflow-y: auto;align-self: stretch;align-items: center;flex: 1 1 0;';
1302
+ wrapper.appendChild(mount);
1303
+
1304
+ document.body.appendChild(wrapper);
1305
+
1306
+ const renderer = new ApiRenderer({
1307
+ mountPoint: `#${mount.id}`,
1308
+ theme: { main: r.color, surface: '#ffffff' }
1309
+ });
1310
+ renderer.render(openapiSpec);
1247
1311
  });
1248
- // 执行渲染
1249
- apiRenderer.render(openapiSpec);
1250
1312
  </script>
1251
1313
  </body>
1252
1314