open_api-loader 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +15 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.rubocop.yml +28 -0
- data/.travis.yml +24 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +99 -0
- data/Rakefile +10 -0
- data/bin/console +6 -0
- data/bin/setup +6 -0
- data/lib/open_api-loader.rb +1 -0
- data/lib/open_api/loader.rb +44 -0
- data/lib/open_api/loader/collector.rb +61 -0
- data/lib/open_api/loader/denormalizer.rb +27 -0
- data/lib/open_api/loader/denormalizer/parameters.rb +46 -0
- data/lib/open_api/loader/denormalizer/security.rb +35 -0
- data/lib/open_api/loader/denormalizer/servers.rb +36 -0
- data/lib/open_api/loader/denormalizer/variables.rb +54 -0
- data/lib/open_api/loader/reader.rb +47 -0
- data/lib/open_api/loader/ref.rb +85 -0
- data/lib/open_api/loader/translator.rb +50 -0
- data/lib/open_api/loader/translator/clean_definitions.rb +16 -0
- data/lib/open_api/loader/translator/convert_bodies.rb +77 -0
- data/lib/open_api/loader/translator/convert_forms.rb +71 -0
- data/lib/open_api/loader/translator/convert_parameters.rb +135 -0
- data/lib/open_api/loader/translator/convert_responses.rb +63 -0
- data/lib/open_api/loader/translator/convert_security_schemes.rb +49 -0
- data/lib/open_api/loader/translator/convert_servers.rb +46 -0
- data/lib/open_api/loader/translator/convert_version.rb +12 -0
- data/lib/open_api/loader/translator/denormalize_consumes.rb +44 -0
- data/lib/open_api/loader/translator/denormalize_parameters.rb +55 -0
- data/lib/open_api/loader/translator/denormalize_produces.rb +53 -0
- data/open_api-loader.gemspec +25 -0
- data/spec/fixtures/oas2/collected.yaml +1012 -0
- data/spec/fixtures/oas2/denormalized.yaml +1462 -0
- data/spec/fixtures/oas2/loaded.yaml +564 -0
- data/spec/fixtures/oas2/models.yaml +118 -0
- data/spec/fixtures/oas2/source.json +1 -0
- data/spec/fixtures/oas2/source.yaml +569 -0
- data/spec/fixtures/oas2/translated.yaml +1396 -0
- data/spec/fixtures/oas3/collected.yaml +233 -0
- data/spec/fixtures/oas3/denormalized.yaml +233 -0
- data/spec/fixtures/oas3/source.json +1 -0
- data/spec/fixtures/oas3/source.yaml +217 -0
- data/spec/loader_spec.rb +53 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/fixture_helpers.rb +18 -0
- data/spec/support/path_helpers.rb +27 -0
- data/spec/unit/collector_spec.rb +31 -0
- data/spec/unit/denormalizer_spec.rb +17 -0
- data/spec/unit/reader_spec.rb +53 -0
- data/spec/unit/ref_spec.rb +107 -0
- data/spec/unit/translator_spec.rb +15 -0
- metadata +232 -0
@@ -0,0 +1,1396 @@
|
|
1
|
+
---
|
2
|
+
openapi: 3.0.0
|
3
|
+
info:
|
4
|
+
description: 'This is a sample server Petstore server. You can find out more about Swagger
|
5
|
+
at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For
|
6
|
+
this sample, you can use the api key `special-key` to test the authorization filters.'
|
7
|
+
version: 1.0.0
|
8
|
+
title: Swagger Petstore
|
9
|
+
termsOfService: http://swagger.io/terms/
|
10
|
+
contact:
|
11
|
+
email: apiteam@swagger.io
|
12
|
+
license:
|
13
|
+
name: Apache 2.0
|
14
|
+
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
15
|
+
servers:
|
16
|
+
- url: "{scheme}://petstore.swagger.io/v2"
|
17
|
+
variables:
|
18
|
+
scheme:
|
19
|
+
enum:
|
20
|
+
- http
|
21
|
+
tags:
|
22
|
+
- name: pet
|
23
|
+
description: Everything about your Pets
|
24
|
+
externalDocs:
|
25
|
+
description: Find out more
|
26
|
+
url: http://swagger.io
|
27
|
+
- name: store
|
28
|
+
description: Access to Petstore orders
|
29
|
+
- name: user
|
30
|
+
description: Operations about user
|
31
|
+
externalDocs:
|
32
|
+
description: Find out more about our store
|
33
|
+
url: http://swagger.io
|
34
|
+
paths:
|
35
|
+
"/pet":
|
36
|
+
post:
|
37
|
+
tags:
|
38
|
+
- pet
|
39
|
+
summary: Add a new pet to the store
|
40
|
+
description: ''
|
41
|
+
operationId: addPet
|
42
|
+
requestBody:
|
43
|
+
description: Pet object that needs to be added to the store
|
44
|
+
required: true
|
45
|
+
content:
|
46
|
+
application/json:
|
47
|
+
schema:
|
48
|
+
type: object
|
49
|
+
required:
|
50
|
+
- name
|
51
|
+
- photoUrls
|
52
|
+
properties:
|
53
|
+
id:
|
54
|
+
type: integer
|
55
|
+
format: int64
|
56
|
+
category:
|
57
|
+
type: object
|
58
|
+
properties:
|
59
|
+
id:
|
60
|
+
type: integer
|
61
|
+
format: int64
|
62
|
+
name:
|
63
|
+
type: string
|
64
|
+
name:
|
65
|
+
type: string
|
66
|
+
example: doggie
|
67
|
+
photoUrls:
|
68
|
+
type: array
|
69
|
+
items:
|
70
|
+
type: string
|
71
|
+
tags:
|
72
|
+
type: array
|
73
|
+
items:
|
74
|
+
type: object
|
75
|
+
properties:
|
76
|
+
id:
|
77
|
+
type: integer
|
78
|
+
format: int64
|
79
|
+
name:
|
80
|
+
type: string
|
81
|
+
status:
|
82
|
+
type: string
|
83
|
+
description: pet status in the store
|
84
|
+
enum:
|
85
|
+
- available
|
86
|
+
- pending
|
87
|
+
- sold
|
88
|
+
application/xml:
|
89
|
+
schema:
|
90
|
+
type: object
|
91
|
+
required:
|
92
|
+
- name
|
93
|
+
- photoUrls
|
94
|
+
properties:
|
95
|
+
id:
|
96
|
+
type: integer
|
97
|
+
format: int64
|
98
|
+
category:
|
99
|
+
type: object
|
100
|
+
properties:
|
101
|
+
id:
|
102
|
+
type: integer
|
103
|
+
format: int64
|
104
|
+
name:
|
105
|
+
type: string
|
106
|
+
xml:
|
107
|
+
name: Category
|
108
|
+
name:
|
109
|
+
type: string
|
110
|
+
example: doggie
|
111
|
+
photoUrls:
|
112
|
+
type: array
|
113
|
+
xml:
|
114
|
+
name: photoUrl
|
115
|
+
wrapped: true
|
116
|
+
items:
|
117
|
+
type: string
|
118
|
+
tags:
|
119
|
+
type: array
|
120
|
+
xml:
|
121
|
+
name: tag
|
122
|
+
wrapped: true
|
123
|
+
items:
|
124
|
+
type: object
|
125
|
+
properties:
|
126
|
+
id:
|
127
|
+
type: integer
|
128
|
+
format: int64
|
129
|
+
name:
|
130
|
+
type: string
|
131
|
+
xml:
|
132
|
+
name: Tag
|
133
|
+
status:
|
134
|
+
type: string
|
135
|
+
description: pet status in the store
|
136
|
+
enum:
|
137
|
+
- available
|
138
|
+
- pending
|
139
|
+
- sold
|
140
|
+
xml:
|
141
|
+
name: Pet
|
142
|
+
responses:
|
143
|
+
'405':
|
144
|
+
description: Invalid input
|
145
|
+
security:
|
146
|
+
- petstore_auth:
|
147
|
+
- write:pets
|
148
|
+
- read:pets
|
149
|
+
put:
|
150
|
+
tags:
|
151
|
+
- pet
|
152
|
+
summary: Update an existing pet
|
153
|
+
description: ''
|
154
|
+
operationId: updatePet
|
155
|
+
requestBody:
|
156
|
+
description: Pet object that needs to be added to the store
|
157
|
+
required: true
|
158
|
+
content:
|
159
|
+
application/json:
|
160
|
+
schema:
|
161
|
+
type: object
|
162
|
+
required:
|
163
|
+
- name
|
164
|
+
- photoUrls
|
165
|
+
properties:
|
166
|
+
id:
|
167
|
+
type: integer
|
168
|
+
format: int64
|
169
|
+
category:
|
170
|
+
type: object
|
171
|
+
properties:
|
172
|
+
id:
|
173
|
+
type: integer
|
174
|
+
format: int64
|
175
|
+
name:
|
176
|
+
type: string
|
177
|
+
name:
|
178
|
+
type: string
|
179
|
+
example: doggie
|
180
|
+
photoUrls:
|
181
|
+
type: array
|
182
|
+
items:
|
183
|
+
type: string
|
184
|
+
tags:
|
185
|
+
type: array
|
186
|
+
items:
|
187
|
+
type: object
|
188
|
+
properties:
|
189
|
+
id:
|
190
|
+
type: integer
|
191
|
+
format: int64
|
192
|
+
name:
|
193
|
+
type: string
|
194
|
+
status:
|
195
|
+
type: string
|
196
|
+
description: pet status in the store
|
197
|
+
enum:
|
198
|
+
- available
|
199
|
+
- pending
|
200
|
+
- sold
|
201
|
+
application/xml:
|
202
|
+
schema:
|
203
|
+
type: object
|
204
|
+
required:
|
205
|
+
- name
|
206
|
+
- photoUrls
|
207
|
+
properties:
|
208
|
+
id:
|
209
|
+
type: integer
|
210
|
+
format: int64
|
211
|
+
category:
|
212
|
+
type: object
|
213
|
+
properties:
|
214
|
+
id:
|
215
|
+
type: integer
|
216
|
+
format: int64
|
217
|
+
name:
|
218
|
+
type: string
|
219
|
+
xml:
|
220
|
+
name: Category
|
221
|
+
name:
|
222
|
+
type: string
|
223
|
+
example: doggie
|
224
|
+
photoUrls:
|
225
|
+
type: array
|
226
|
+
xml:
|
227
|
+
name: photoUrl
|
228
|
+
wrapped: true
|
229
|
+
items:
|
230
|
+
type: string
|
231
|
+
tags:
|
232
|
+
type: array
|
233
|
+
xml:
|
234
|
+
name: tag
|
235
|
+
wrapped: true
|
236
|
+
items:
|
237
|
+
type: object
|
238
|
+
properties:
|
239
|
+
id:
|
240
|
+
type: integer
|
241
|
+
format: int64
|
242
|
+
name:
|
243
|
+
type: string
|
244
|
+
xml:
|
245
|
+
name: Tag
|
246
|
+
status:
|
247
|
+
type: string
|
248
|
+
description: pet status in the store
|
249
|
+
enum:
|
250
|
+
- available
|
251
|
+
- pending
|
252
|
+
- sold
|
253
|
+
xml:
|
254
|
+
name: Pet
|
255
|
+
responses:
|
256
|
+
'400':
|
257
|
+
description: Invalid ID supplied
|
258
|
+
'404':
|
259
|
+
description: Pet not found
|
260
|
+
'405':
|
261
|
+
description: Validators exception
|
262
|
+
security:
|
263
|
+
- petstore_auth:
|
264
|
+
- write:pets
|
265
|
+
- read:pets
|
266
|
+
"/pet/findByStatus":
|
267
|
+
get:
|
268
|
+
tags:
|
269
|
+
- pet
|
270
|
+
summary: Finds Pets by status
|
271
|
+
description: Multiple status values can be provided with comma separated strings
|
272
|
+
operationId: findPetsByStatus
|
273
|
+
parameters:
|
274
|
+
- name: status
|
275
|
+
in: query
|
276
|
+
description: Status values that need to be considered for filter
|
277
|
+
required: true
|
278
|
+
schema:
|
279
|
+
type: array
|
280
|
+
items:
|
281
|
+
type: string
|
282
|
+
enum:
|
283
|
+
- available
|
284
|
+
- pending
|
285
|
+
- sold
|
286
|
+
default: available
|
287
|
+
style: form
|
288
|
+
explode: true
|
289
|
+
responses:
|
290
|
+
'200':
|
291
|
+
description: successful operation
|
292
|
+
content:
|
293
|
+
application/json:
|
294
|
+
schema:
|
295
|
+
type: array
|
296
|
+
items:
|
297
|
+
type: object
|
298
|
+
required:
|
299
|
+
- name
|
300
|
+
- photoUrls
|
301
|
+
properties:
|
302
|
+
id:
|
303
|
+
type: integer
|
304
|
+
format: int64
|
305
|
+
category:
|
306
|
+
type: object
|
307
|
+
properties:
|
308
|
+
id:
|
309
|
+
type: integer
|
310
|
+
format: int64
|
311
|
+
name:
|
312
|
+
type: string
|
313
|
+
name:
|
314
|
+
type: string
|
315
|
+
example: doggie
|
316
|
+
photoUrls:
|
317
|
+
type: array
|
318
|
+
items:
|
319
|
+
type: string
|
320
|
+
tags:
|
321
|
+
type: array
|
322
|
+
items:
|
323
|
+
type: object
|
324
|
+
properties:
|
325
|
+
id:
|
326
|
+
type: integer
|
327
|
+
format: int64
|
328
|
+
name:
|
329
|
+
type: string
|
330
|
+
status:
|
331
|
+
type: string
|
332
|
+
description: pet status in the store
|
333
|
+
enum:
|
334
|
+
- available
|
335
|
+
- pending
|
336
|
+
- sold
|
337
|
+
application/xml:
|
338
|
+
schema:
|
339
|
+
type: array
|
340
|
+
items:
|
341
|
+
type: object
|
342
|
+
required:
|
343
|
+
- name
|
344
|
+
- photoUrls
|
345
|
+
properties:
|
346
|
+
id:
|
347
|
+
type: integer
|
348
|
+
format: int64
|
349
|
+
category:
|
350
|
+
type: object
|
351
|
+
properties:
|
352
|
+
id:
|
353
|
+
type: integer
|
354
|
+
format: int64
|
355
|
+
name:
|
356
|
+
type: string
|
357
|
+
xml:
|
358
|
+
name: Category
|
359
|
+
name:
|
360
|
+
type: string
|
361
|
+
example: doggie
|
362
|
+
photoUrls:
|
363
|
+
type: array
|
364
|
+
xml:
|
365
|
+
name: photoUrl
|
366
|
+
wrapped: true
|
367
|
+
items:
|
368
|
+
type: string
|
369
|
+
tags:
|
370
|
+
type: array
|
371
|
+
xml:
|
372
|
+
name: tag
|
373
|
+
wrapped: true
|
374
|
+
items:
|
375
|
+
type: object
|
376
|
+
properties:
|
377
|
+
id:
|
378
|
+
type: integer
|
379
|
+
format: int64
|
380
|
+
name:
|
381
|
+
type: string
|
382
|
+
xml:
|
383
|
+
name: Tag
|
384
|
+
status:
|
385
|
+
type: string
|
386
|
+
description: pet status in the store
|
387
|
+
enum:
|
388
|
+
- available
|
389
|
+
- pending
|
390
|
+
- sold
|
391
|
+
xml:
|
392
|
+
name: Pet
|
393
|
+
'400':
|
394
|
+
description: Invalid status value
|
395
|
+
security:
|
396
|
+
- petstore_auth:
|
397
|
+
- write:pets
|
398
|
+
- read:pets
|
399
|
+
"/pet/findByTags":
|
400
|
+
get:
|
401
|
+
tags:
|
402
|
+
- pet
|
403
|
+
summary: Finds Pets by tags
|
404
|
+
description: Muliple tags can be provided with comma separated strings. Use tag1,
|
405
|
+
tag2, tag3 for testing.
|
406
|
+
operationId: findPetsByTags
|
407
|
+
parameters:
|
408
|
+
- name: tags
|
409
|
+
in: query
|
410
|
+
description: Tags to filter by
|
411
|
+
required: true
|
412
|
+
schema:
|
413
|
+
type: array
|
414
|
+
items:
|
415
|
+
type: string
|
416
|
+
style: form
|
417
|
+
explode: true
|
418
|
+
responses:
|
419
|
+
'200':
|
420
|
+
description: successful operation
|
421
|
+
content:
|
422
|
+
application/json:
|
423
|
+
schema:
|
424
|
+
type: array
|
425
|
+
items:
|
426
|
+
type: object
|
427
|
+
required:
|
428
|
+
- name
|
429
|
+
- photoUrls
|
430
|
+
properties:
|
431
|
+
id:
|
432
|
+
type: integer
|
433
|
+
format: int64
|
434
|
+
category:
|
435
|
+
type: object
|
436
|
+
properties:
|
437
|
+
id:
|
438
|
+
type: integer
|
439
|
+
format: int64
|
440
|
+
name:
|
441
|
+
type: string
|
442
|
+
name:
|
443
|
+
type: string
|
444
|
+
example: doggie
|
445
|
+
photoUrls:
|
446
|
+
type: array
|
447
|
+
items:
|
448
|
+
type: string
|
449
|
+
tags:
|
450
|
+
type: array
|
451
|
+
items:
|
452
|
+
type: object
|
453
|
+
properties:
|
454
|
+
id:
|
455
|
+
type: integer
|
456
|
+
format: int64
|
457
|
+
name:
|
458
|
+
type: string
|
459
|
+
status:
|
460
|
+
type: string
|
461
|
+
description: pet status in the store
|
462
|
+
enum:
|
463
|
+
- available
|
464
|
+
- pending
|
465
|
+
- sold
|
466
|
+
application/xml:
|
467
|
+
schema:
|
468
|
+
type: array
|
469
|
+
items:
|
470
|
+
type: object
|
471
|
+
required:
|
472
|
+
- name
|
473
|
+
- photoUrls
|
474
|
+
properties:
|
475
|
+
id:
|
476
|
+
type: integer
|
477
|
+
format: int64
|
478
|
+
category:
|
479
|
+
type: object
|
480
|
+
properties:
|
481
|
+
id:
|
482
|
+
type: integer
|
483
|
+
format: int64
|
484
|
+
name:
|
485
|
+
type: string
|
486
|
+
xml:
|
487
|
+
name: Category
|
488
|
+
name:
|
489
|
+
type: string
|
490
|
+
example: doggie
|
491
|
+
photoUrls:
|
492
|
+
type: array
|
493
|
+
xml:
|
494
|
+
name: photoUrl
|
495
|
+
wrapped: true
|
496
|
+
items:
|
497
|
+
type: string
|
498
|
+
tags:
|
499
|
+
type: array
|
500
|
+
xml:
|
501
|
+
name: tag
|
502
|
+
wrapped: true
|
503
|
+
items:
|
504
|
+
type: object
|
505
|
+
properties:
|
506
|
+
id:
|
507
|
+
type: integer
|
508
|
+
format: int64
|
509
|
+
name:
|
510
|
+
type: string
|
511
|
+
xml:
|
512
|
+
name: Tag
|
513
|
+
status:
|
514
|
+
type: string
|
515
|
+
description: pet status in the store
|
516
|
+
enum:
|
517
|
+
- available
|
518
|
+
- pending
|
519
|
+
- sold
|
520
|
+
xml:
|
521
|
+
name: Pet
|
522
|
+
'400':
|
523
|
+
description: Invalid tag value
|
524
|
+
security:
|
525
|
+
- petstore_auth:
|
526
|
+
- write:pets
|
527
|
+
- read:pets
|
528
|
+
deprecated: true
|
529
|
+
"/pet/{petId}":
|
530
|
+
parameters:
|
531
|
+
- name: petId
|
532
|
+
in: path
|
533
|
+
description: ID of pet
|
534
|
+
required: true
|
535
|
+
schema:
|
536
|
+
type: integer
|
537
|
+
format: int64
|
538
|
+
get:
|
539
|
+
tags:
|
540
|
+
- pet
|
541
|
+
summary: Find pet by ID
|
542
|
+
description: Returns a single pet
|
543
|
+
operationId: getPetById
|
544
|
+
responses:
|
545
|
+
'200':
|
546
|
+
description: successful operation
|
547
|
+
content:
|
548
|
+
application/xml:
|
549
|
+
schema:
|
550
|
+
type: object
|
551
|
+
required:
|
552
|
+
- name
|
553
|
+
- photoUrls
|
554
|
+
properties:
|
555
|
+
id:
|
556
|
+
type: integer
|
557
|
+
format: int64
|
558
|
+
category:
|
559
|
+
type: object
|
560
|
+
properties:
|
561
|
+
id:
|
562
|
+
type: integer
|
563
|
+
format: int64
|
564
|
+
name:
|
565
|
+
type: string
|
566
|
+
xml:
|
567
|
+
name: Category
|
568
|
+
name:
|
569
|
+
type: string
|
570
|
+
example: doggie
|
571
|
+
photoUrls:
|
572
|
+
type: array
|
573
|
+
xml:
|
574
|
+
name: photoUrl
|
575
|
+
wrapped: true
|
576
|
+
items:
|
577
|
+
type: string
|
578
|
+
tags:
|
579
|
+
type: array
|
580
|
+
xml:
|
581
|
+
name: tag
|
582
|
+
wrapped: true
|
583
|
+
items:
|
584
|
+
type: object
|
585
|
+
properties:
|
586
|
+
id:
|
587
|
+
type: integer
|
588
|
+
format: int64
|
589
|
+
name:
|
590
|
+
type: string
|
591
|
+
xml:
|
592
|
+
name: Tag
|
593
|
+
status:
|
594
|
+
type: string
|
595
|
+
description: pet status in the store
|
596
|
+
enum:
|
597
|
+
- available
|
598
|
+
- pending
|
599
|
+
- sold
|
600
|
+
xml:
|
601
|
+
name: Pet
|
602
|
+
application/json:
|
603
|
+
schema:
|
604
|
+
type: object
|
605
|
+
required:
|
606
|
+
- name
|
607
|
+
- photoUrls
|
608
|
+
properties:
|
609
|
+
id:
|
610
|
+
type: integer
|
611
|
+
format: int64
|
612
|
+
category:
|
613
|
+
type: object
|
614
|
+
properties:
|
615
|
+
id:
|
616
|
+
type: integer
|
617
|
+
format: int64
|
618
|
+
name:
|
619
|
+
type: string
|
620
|
+
name:
|
621
|
+
type: string
|
622
|
+
example: doggie
|
623
|
+
photoUrls:
|
624
|
+
type: array
|
625
|
+
items:
|
626
|
+
type: string
|
627
|
+
tags:
|
628
|
+
type: array
|
629
|
+
items:
|
630
|
+
type: object
|
631
|
+
properties:
|
632
|
+
id:
|
633
|
+
type: integer
|
634
|
+
format: int64
|
635
|
+
name:
|
636
|
+
type: string
|
637
|
+
status:
|
638
|
+
type: string
|
639
|
+
description: pet status in the store
|
640
|
+
enum:
|
641
|
+
- available
|
642
|
+
- pending
|
643
|
+
- sold
|
644
|
+
'400':
|
645
|
+
description: Invalid ID supplied
|
646
|
+
'404':
|
647
|
+
description: Pet not found
|
648
|
+
security:
|
649
|
+
- api_key: []
|
650
|
+
post:
|
651
|
+
tags:
|
652
|
+
- pet
|
653
|
+
summary: Updates a pet in the store with form data
|
654
|
+
description: ''
|
655
|
+
operationId: updatePetWithForm
|
656
|
+
requestBody:
|
657
|
+
content:
|
658
|
+
application/x-www-form-urlencoded:
|
659
|
+
schema:
|
660
|
+
type: object
|
661
|
+
properties:
|
662
|
+
name:
|
663
|
+
description: Updated name of the pet
|
664
|
+
required: false
|
665
|
+
type: string
|
666
|
+
status:
|
667
|
+
description: Updated status of the pet
|
668
|
+
required: false
|
669
|
+
type: string
|
670
|
+
responses:
|
671
|
+
'405':
|
672
|
+
description: Invalid input
|
673
|
+
security:
|
674
|
+
- petstore_auth:
|
675
|
+
- write:pets
|
676
|
+
- read:pets
|
677
|
+
delete:
|
678
|
+
tags:
|
679
|
+
- pet
|
680
|
+
summary: Deletes a pet
|
681
|
+
description: ''
|
682
|
+
operationId: deletePet
|
683
|
+
parameters:
|
684
|
+
- name: api_key
|
685
|
+
in: header
|
686
|
+
required: false
|
687
|
+
schema:
|
688
|
+
type: string
|
689
|
+
responses:
|
690
|
+
'400':
|
691
|
+
description: Invalid ID supplied
|
692
|
+
'404':
|
693
|
+
description: Pet not found
|
694
|
+
security:
|
695
|
+
- petstore_auth:
|
696
|
+
- write:pets
|
697
|
+
- read:pets
|
698
|
+
"/pet/{petId}/uploadImage":
|
699
|
+
parameters:
|
700
|
+
- name: petId
|
701
|
+
in: path
|
702
|
+
description: ID of pet
|
703
|
+
required: true
|
704
|
+
schema:
|
705
|
+
type: integer
|
706
|
+
format: int64
|
707
|
+
post:
|
708
|
+
tags:
|
709
|
+
- pet
|
710
|
+
summary: uploads an image
|
711
|
+
description: ''
|
712
|
+
operationId: uploadFile
|
713
|
+
requestBody:
|
714
|
+
content:
|
715
|
+
multipart/form-data:
|
716
|
+
schema:
|
717
|
+
type: object
|
718
|
+
properties:
|
719
|
+
additionalMetadata:
|
720
|
+
description: Additional data to pass to server
|
721
|
+
required: false
|
722
|
+
type: string
|
723
|
+
file:
|
724
|
+
description: file to upload
|
725
|
+
required: false
|
726
|
+
type: string
|
727
|
+
responses:
|
728
|
+
'200':
|
729
|
+
description: successful operation
|
730
|
+
content:
|
731
|
+
application/json:
|
732
|
+
schema:
|
733
|
+
type: object
|
734
|
+
properties:
|
735
|
+
code:
|
736
|
+
type: integer
|
737
|
+
format: int32
|
738
|
+
type:
|
739
|
+
type: string
|
740
|
+
message:
|
741
|
+
type: string
|
742
|
+
security:
|
743
|
+
- petstore_auth:
|
744
|
+
- write:pets
|
745
|
+
- read:pets
|
746
|
+
"/store/inventory":
|
747
|
+
get:
|
748
|
+
tags:
|
749
|
+
- store
|
750
|
+
summary: Returns pet inventories by status
|
751
|
+
description: Returns a map of status codes to quantities
|
752
|
+
operationId: getInventory
|
753
|
+
responses:
|
754
|
+
'200':
|
755
|
+
description: successful operation
|
756
|
+
content:
|
757
|
+
application/json:
|
758
|
+
schema:
|
759
|
+
type: object
|
760
|
+
additionalProperties:
|
761
|
+
type: integer
|
762
|
+
format: int32
|
763
|
+
security:
|
764
|
+
- api_key: []
|
765
|
+
"/store/order":
|
766
|
+
post:
|
767
|
+
tags:
|
768
|
+
- store
|
769
|
+
summary: Place an order for a pet
|
770
|
+
description: ''
|
771
|
+
operationId: placeOrder
|
772
|
+
requestBody:
|
773
|
+
required: true
|
774
|
+
description: order placed for purchasing the pet
|
775
|
+
content:
|
776
|
+
application/json:
|
777
|
+
schema:
|
778
|
+
type: object
|
779
|
+
properties:
|
780
|
+
id:
|
781
|
+
type: integer
|
782
|
+
format: int64
|
783
|
+
petId:
|
784
|
+
type: integer
|
785
|
+
format: int64
|
786
|
+
quantity:
|
787
|
+
type: integer
|
788
|
+
format: int32
|
789
|
+
shipDate:
|
790
|
+
type: string
|
791
|
+
format: date-time
|
792
|
+
status:
|
793
|
+
type: string
|
794
|
+
description: Order Status
|
795
|
+
enum:
|
796
|
+
- placed
|
797
|
+
- approved
|
798
|
+
- delivered
|
799
|
+
complete:
|
800
|
+
type: boolean
|
801
|
+
default: false
|
802
|
+
application/xml:
|
803
|
+
schema:
|
804
|
+
type: object
|
805
|
+
properties:
|
806
|
+
id:
|
807
|
+
type: integer
|
808
|
+
format: int64
|
809
|
+
petId:
|
810
|
+
type: integer
|
811
|
+
format: int64
|
812
|
+
quantity:
|
813
|
+
type: integer
|
814
|
+
format: int32
|
815
|
+
shipDate:
|
816
|
+
type: string
|
817
|
+
format: date-time
|
818
|
+
status:
|
819
|
+
type: string
|
820
|
+
description: Order Status
|
821
|
+
enum:
|
822
|
+
- placed
|
823
|
+
- approved
|
824
|
+
- delivered
|
825
|
+
complete:
|
826
|
+
type: boolean
|
827
|
+
default: false
|
828
|
+
xml:
|
829
|
+
name: Order
|
830
|
+
responses:
|
831
|
+
'200':
|
832
|
+
description: successful operation
|
833
|
+
content:
|
834
|
+
application/json:
|
835
|
+
schema:
|
836
|
+
type: object
|
837
|
+
properties:
|
838
|
+
id:
|
839
|
+
type: integer
|
840
|
+
format: int64
|
841
|
+
petId:
|
842
|
+
type: integer
|
843
|
+
format: int64
|
844
|
+
quantity:
|
845
|
+
type: integer
|
846
|
+
format: int32
|
847
|
+
shipDate:
|
848
|
+
type: string
|
849
|
+
format: date-time
|
850
|
+
status:
|
851
|
+
type: string
|
852
|
+
description: Order Status
|
853
|
+
enum:
|
854
|
+
- placed
|
855
|
+
- approved
|
856
|
+
- delivered
|
857
|
+
complete:
|
858
|
+
type: boolean
|
859
|
+
default: false
|
860
|
+
application/xml:
|
861
|
+
schema:
|
862
|
+
type: object
|
863
|
+
properties:
|
864
|
+
id:
|
865
|
+
type: integer
|
866
|
+
format: int64
|
867
|
+
petId:
|
868
|
+
type: integer
|
869
|
+
format: int64
|
870
|
+
quantity:
|
871
|
+
type: integer
|
872
|
+
format: int32
|
873
|
+
shipDate:
|
874
|
+
type: string
|
875
|
+
format: date-time
|
876
|
+
status:
|
877
|
+
type: string
|
878
|
+
description: Order Status
|
879
|
+
enum:
|
880
|
+
- placed
|
881
|
+
- approved
|
882
|
+
- delivered
|
883
|
+
complete:
|
884
|
+
type: boolean
|
885
|
+
default: false
|
886
|
+
xml:
|
887
|
+
name: Order
|
888
|
+
'400':
|
889
|
+
description: Invalid Order
|
890
|
+
"/store/order/{orderId}":
|
891
|
+
parameters:
|
892
|
+
- name: "orderId"
|
893
|
+
in: "path"
|
894
|
+
description: ID of purchase order
|
895
|
+
required: true
|
896
|
+
schema:
|
897
|
+
type: "integer"
|
898
|
+
maximum: 10.0
|
899
|
+
minimum: 1.0
|
900
|
+
format: "int64"
|
901
|
+
get:
|
902
|
+
tags:
|
903
|
+
- store
|
904
|
+
summary: Find purchase order by ID
|
905
|
+
description: For valid response try integer IDs with value >= 1 and <= 10. Other
|
906
|
+
values will generated exceptions
|
907
|
+
operationId: getOrderById
|
908
|
+
responses:
|
909
|
+
'200':
|
910
|
+
description: successful operation
|
911
|
+
content:
|
912
|
+
application/json:
|
913
|
+
schema:
|
914
|
+
type: object
|
915
|
+
properties:
|
916
|
+
id:
|
917
|
+
type: integer
|
918
|
+
format: int64
|
919
|
+
petId:
|
920
|
+
type: integer
|
921
|
+
format: int64
|
922
|
+
quantity:
|
923
|
+
type: integer
|
924
|
+
format: int32
|
925
|
+
shipDate:
|
926
|
+
type: string
|
927
|
+
format: date-time
|
928
|
+
status:
|
929
|
+
type: string
|
930
|
+
description: Order Status
|
931
|
+
enum:
|
932
|
+
- placed
|
933
|
+
- approved
|
934
|
+
- delivered
|
935
|
+
complete:
|
936
|
+
type: boolean
|
937
|
+
default: false
|
938
|
+
application/xml:
|
939
|
+
schema:
|
940
|
+
type: object
|
941
|
+
properties:
|
942
|
+
id:
|
943
|
+
type: integer
|
944
|
+
format: int64
|
945
|
+
petId:
|
946
|
+
type: integer
|
947
|
+
format: int64
|
948
|
+
quantity:
|
949
|
+
type: integer
|
950
|
+
format: int32
|
951
|
+
shipDate:
|
952
|
+
type: string
|
953
|
+
format: date-time
|
954
|
+
status:
|
955
|
+
type: string
|
956
|
+
description: Order Status
|
957
|
+
enum:
|
958
|
+
- placed
|
959
|
+
- approved
|
960
|
+
- delivered
|
961
|
+
complete:
|
962
|
+
type: boolean
|
963
|
+
default: false
|
964
|
+
xml:
|
965
|
+
name: Order
|
966
|
+
'400':
|
967
|
+
description: Invalid ID supplied
|
968
|
+
'404':
|
969
|
+
description: Order not found
|
970
|
+
delete:
|
971
|
+
tags:
|
972
|
+
- store
|
973
|
+
summary: Delete purchase order by ID
|
974
|
+
description: For valid response try integer IDs with positive integer value. Negative
|
975
|
+
or non-integer values will generate API errors
|
976
|
+
operationId: deleteOrder
|
977
|
+
responses:
|
978
|
+
'400':
|
979
|
+
description: Invalid ID supplied
|
980
|
+
'404':
|
981
|
+
description: Order not found
|
982
|
+
"/user":
|
983
|
+
post:
|
984
|
+
tags:
|
985
|
+
- user
|
986
|
+
summary: Create user
|
987
|
+
description: This can only be done by the logged in user.
|
988
|
+
operationId: createUser
|
989
|
+
requestBody:
|
990
|
+
description: Created user object
|
991
|
+
required: true
|
992
|
+
content:
|
993
|
+
application/json:
|
994
|
+
schema:
|
995
|
+
type: object
|
996
|
+
properties:
|
997
|
+
id:
|
998
|
+
type: integer
|
999
|
+
format: int64
|
1000
|
+
username:
|
1001
|
+
type: string
|
1002
|
+
firstName:
|
1003
|
+
type: string
|
1004
|
+
lastName:
|
1005
|
+
type: string
|
1006
|
+
email:
|
1007
|
+
type: string
|
1008
|
+
password:
|
1009
|
+
type: string
|
1010
|
+
phone:
|
1011
|
+
type: string
|
1012
|
+
userStatus:
|
1013
|
+
type: integer
|
1014
|
+
format: int32
|
1015
|
+
description: User Status
|
1016
|
+
application/xml:
|
1017
|
+
schema:
|
1018
|
+
type: object
|
1019
|
+
properties:
|
1020
|
+
id:
|
1021
|
+
type: integer
|
1022
|
+
format: int64
|
1023
|
+
username:
|
1024
|
+
type: string
|
1025
|
+
firstName:
|
1026
|
+
type: string
|
1027
|
+
lastName:
|
1028
|
+
type: string
|
1029
|
+
email:
|
1030
|
+
type: string
|
1031
|
+
password:
|
1032
|
+
type: string
|
1033
|
+
phone:
|
1034
|
+
type: string
|
1035
|
+
userStatus:
|
1036
|
+
type: integer
|
1037
|
+
format: int32
|
1038
|
+
description: User Status
|
1039
|
+
xml:
|
1040
|
+
name: User
|
1041
|
+
responses:
|
1042
|
+
default:
|
1043
|
+
description: successful operation
|
1044
|
+
"/user/createWithArray":
|
1045
|
+
post:
|
1046
|
+
tags:
|
1047
|
+
- user
|
1048
|
+
summary: Creates list of users with given input array
|
1049
|
+
description: ''
|
1050
|
+
operationId: createUsersWithArrayInput
|
1051
|
+
requestBody:
|
1052
|
+
description: List of user object
|
1053
|
+
required: true
|
1054
|
+
content:
|
1055
|
+
application/json:
|
1056
|
+
schema:
|
1057
|
+
type: array
|
1058
|
+
items:
|
1059
|
+
type: object
|
1060
|
+
properties:
|
1061
|
+
id:
|
1062
|
+
type: integer
|
1063
|
+
format: int64
|
1064
|
+
username:
|
1065
|
+
type: string
|
1066
|
+
firstName:
|
1067
|
+
type: string
|
1068
|
+
lastName:
|
1069
|
+
type: string
|
1070
|
+
email:
|
1071
|
+
type: string
|
1072
|
+
password:
|
1073
|
+
type: string
|
1074
|
+
phone:
|
1075
|
+
type: string
|
1076
|
+
userStatus:
|
1077
|
+
type: integer
|
1078
|
+
format: int32
|
1079
|
+
description: User Status
|
1080
|
+
application/xml:
|
1081
|
+
schema:
|
1082
|
+
type: array
|
1083
|
+
items:
|
1084
|
+
type: object
|
1085
|
+
properties:
|
1086
|
+
id:
|
1087
|
+
type: integer
|
1088
|
+
format: int64
|
1089
|
+
username:
|
1090
|
+
type: string
|
1091
|
+
firstName:
|
1092
|
+
type: string
|
1093
|
+
lastName:
|
1094
|
+
type: string
|
1095
|
+
email:
|
1096
|
+
type: string
|
1097
|
+
password:
|
1098
|
+
type: string
|
1099
|
+
phone:
|
1100
|
+
type: string
|
1101
|
+
userStatus:
|
1102
|
+
type: integer
|
1103
|
+
format: int32
|
1104
|
+
description: User Status
|
1105
|
+
xml:
|
1106
|
+
name: User
|
1107
|
+
responses:
|
1108
|
+
default:
|
1109
|
+
description: successful operation
|
1110
|
+
"/user/createWithList":
|
1111
|
+
post:
|
1112
|
+
tags:
|
1113
|
+
- user
|
1114
|
+
summary: Creates list of users with given input array
|
1115
|
+
description: ''
|
1116
|
+
operationId: createUsersWithListInput
|
1117
|
+
requestBody:
|
1118
|
+
description: List of user object
|
1119
|
+
required: true
|
1120
|
+
content:
|
1121
|
+
application/json:
|
1122
|
+
schema:
|
1123
|
+
type: array
|
1124
|
+
items:
|
1125
|
+
type: object
|
1126
|
+
properties:
|
1127
|
+
id:
|
1128
|
+
type: integer
|
1129
|
+
format: int64
|
1130
|
+
username:
|
1131
|
+
type: string
|
1132
|
+
firstName:
|
1133
|
+
type: string
|
1134
|
+
lastName:
|
1135
|
+
type: string
|
1136
|
+
email:
|
1137
|
+
type: string
|
1138
|
+
password:
|
1139
|
+
type: string
|
1140
|
+
phone:
|
1141
|
+
type: string
|
1142
|
+
userStatus:
|
1143
|
+
type: integer
|
1144
|
+
format: int32
|
1145
|
+
description: User Status
|
1146
|
+
application/xml:
|
1147
|
+
schema:
|
1148
|
+
type: array
|
1149
|
+
items:
|
1150
|
+
type: object
|
1151
|
+
properties:
|
1152
|
+
id:
|
1153
|
+
type: integer
|
1154
|
+
format: int64
|
1155
|
+
username:
|
1156
|
+
type: string
|
1157
|
+
firstName:
|
1158
|
+
type: string
|
1159
|
+
lastName:
|
1160
|
+
type: string
|
1161
|
+
email:
|
1162
|
+
type: string
|
1163
|
+
password:
|
1164
|
+
type: string
|
1165
|
+
phone:
|
1166
|
+
type: string
|
1167
|
+
userStatus:
|
1168
|
+
type: integer
|
1169
|
+
format: int32
|
1170
|
+
description: User Status
|
1171
|
+
xml:
|
1172
|
+
name: User
|
1173
|
+
responses:
|
1174
|
+
default:
|
1175
|
+
description: successful operation
|
1176
|
+
"/user/login":
|
1177
|
+
get:
|
1178
|
+
tags:
|
1179
|
+
- user
|
1180
|
+
summary: Logs user into the system
|
1181
|
+
description: ''
|
1182
|
+
operationId: loginUser
|
1183
|
+
parameters:
|
1184
|
+
- name: username
|
1185
|
+
in: query
|
1186
|
+
description: The user name for login
|
1187
|
+
required: true
|
1188
|
+
schema:
|
1189
|
+
type: string
|
1190
|
+
- name: password
|
1191
|
+
in: query
|
1192
|
+
description: The password for login in clear text
|
1193
|
+
required: true
|
1194
|
+
schema:
|
1195
|
+
type: string
|
1196
|
+
responses:
|
1197
|
+
'200':
|
1198
|
+
description: successful operation
|
1199
|
+
headers:
|
1200
|
+
X-Rate-Limit:
|
1201
|
+
description: calls per hour allowed by the user
|
1202
|
+
schema:
|
1203
|
+
type: integer
|
1204
|
+
format: int32
|
1205
|
+
X-Expires-After:
|
1206
|
+
description: date in UTC when token expires
|
1207
|
+
schema:
|
1208
|
+
type: string
|
1209
|
+
format: date-time
|
1210
|
+
content:
|
1211
|
+
application/xml:
|
1212
|
+
schema:
|
1213
|
+
type: string
|
1214
|
+
application/json:
|
1215
|
+
schema:
|
1216
|
+
type: string
|
1217
|
+
'400':
|
1218
|
+
description: Invalid username/password supplied
|
1219
|
+
"/user/logout":
|
1220
|
+
get:
|
1221
|
+
tags:
|
1222
|
+
- user
|
1223
|
+
summary: Logs out current logged in user session
|
1224
|
+
description: ''
|
1225
|
+
operationId: logoutUser
|
1226
|
+
responses:
|
1227
|
+
default:
|
1228
|
+
description: successful operation
|
1229
|
+
"/user/{username}":
|
1230
|
+
parameters:
|
1231
|
+
- name: username
|
1232
|
+
in: path
|
1233
|
+
description: 'The name of the user. Use user1 for testing. '
|
1234
|
+
required: true
|
1235
|
+
schema:
|
1236
|
+
type: string
|
1237
|
+
get:
|
1238
|
+
tags:
|
1239
|
+
- user
|
1240
|
+
summary: Get user by user name
|
1241
|
+
description: ''
|
1242
|
+
operationId: getUserByName
|
1243
|
+
responses:
|
1244
|
+
'200':
|
1245
|
+
description: successful operation
|
1246
|
+
content:
|
1247
|
+
application/json:
|
1248
|
+
schema:
|
1249
|
+
type: object
|
1250
|
+
properties:
|
1251
|
+
id:
|
1252
|
+
type: integer
|
1253
|
+
format: int64
|
1254
|
+
username:
|
1255
|
+
type: string
|
1256
|
+
firstName:
|
1257
|
+
type: string
|
1258
|
+
lastName:
|
1259
|
+
type: string
|
1260
|
+
email:
|
1261
|
+
type: string
|
1262
|
+
password:
|
1263
|
+
type: string
|
1264
|
+
phone:
|
1265
|
+
type: string
|
1266
|
+
userStatus:
|
1267
|
+
type: integer
|
1268
|
+
format: int32
|
1269
|
+
description: User Status
|
1270
|
+
application/xml:
|
1271
|
+
schema:
|
1272
|
+
type: object
|
1273
|
+
properties:
|
1274
|
+
id:
|
1275
|
+
type: integer
|
1276
|
+
format: int64
|
1277
|
+
username:
|
1278
|
+
type: string
|
1279
|
+
firstName:
|
1280
|
+
type: string
|
1281
|
+
lastName:
|
1282
|
+
type: string
|
1283
|
+
email:
|
1284
|
+
type: string
|
1285
|
+
password:
|
1286
|
+
type: string
|
1287
|
+
phone:
|
1288
|
+
type: string
|
1289
|
+
userStatus:
|
1290
|
+
type: integer
|
1291
|
+
format: int32
|
1292
|
+
description: User Status
|
1293
|
+
xml:
|
1294
|
+
name: User
|
1295
|
+
'400':
|
1296
|
+
description: Invalid username supplied
|
1297
|
+
'404':
|
1298
|
+
description: User not found
|
1299
|
+
put:
|
1300
|
+
tags:
|
1301
|
+
- user
|
1302
|
+
summary: Updated user
|
1303
|
+
description: This can only be done by the logged in user.
|
1304
|
+
operationId: updateUser
|
1305
|
+
requestBody:
|
1306
|
+
description: Updated user object
|
1307
|
+
required: true
|
1308
|
+
content:
|
1309
|
+
application/json:
|
1310
|
+
schema:
|
1311
|
+
type: object
|
1312
|
+
properties:
|
1313
|
+
id:
|
1314
|
+
type: integer
|
1315
|
+
format: int64
|
1316
|
+
username:
|
1317
|
+
type: string
|
1318
|
+
firstName:
|
1319
|
+
type: string
|
1320
|
+
lastName:
|
1321
|
+
type: string
|
1322
|
+
email:
|
1323
|
+
type: string
|
1324
|
+
password:
|
1325
|
+
type: string
|
1326
|
+
phone:
|
1327
|
+
type: string
|
1328
|
+
userStatus:
|
1329
|
+
type: integer
|
1330
|
+
format: int32
|
1331
|
+
description: User Status
|
1332
|
+
application/xml:
|
1333
|
+
schema:
|
1334
|
+
type: object
|
1335
|
+
properties:
|
1336
|
+
id:
|
1337
|
+
type: integer
|
1338
|
+
format: int64
|
1339
|
+
username:
|
1340
|
+
type: string
|
1341
|
+
firstName:
|
1342
|
+
type: string
|
1343
|
+
lastName:
|
1344
|
+
type: string
|
1345
|
+
email:
|
1346
|
+
type: string
|
1347
|
+
password:
|
1348
|
+
type: string
|
1349
|
+
phone:
|
1350
|
+
type: string
|
1351
|
+
userStatus:
|
1352
|
+
type: integer
|
1353
|
+
format: int32
|
1354
|
+
description: User Status
|
1355
|
+
xml:
|
1356
|
+
name: User
|
1357
|
+
responses:
|
1358
|
+
'400':
|
1359
|
+
description: Invalid user supplied
|
1360
|
+
'404':
|
1361
|
+
description: User not found
|
1362
|
+
delete:
|
1363
|
+
tags:
|
1364
|
+
- user
|
1365
|
+
summary: Delete user
|
1366
|
+
description: This can only be done by the logged in user.
|
1367
|
+
operationId: deleteUser
|
1368
|
+
parameters:
|
1369
|
+
- name: username
|
1370
|
+
in: path
|
1371
|
+
description: 'The name of the user to be deleted. '
|
1372
|
+
required: true
|
1373
|
+
schema:
|
1374
|
+
type: string
|
1375
|
+
responses:
|
1376
|
+
'400':
|
1377
|
+
description: Invalid username supplied
|
1378
|
+
'404':
|
1379
|
+
description: User not found
|
1380
|
+
components:
|
1381
|
+
securitySchemes:
|
1382
|
+
petstore_auth:
|
1383
|
+
type: oauth2
|
1384
|
+
flows:
|
1385
|
+
implicit:
|
1386
|
+
authorizationUrl: http://petstore.swagger.io/oauth/dialog
|
1387
|
+
scopes:
|
1388
|
+
write:pets: modify pets in your account
|
1389
|
+
read:pets: read your pets
|
1390
|
+
api_key:
|
1391
|
+
type: apiKey
|
1392
|
+
name: api_key
|
1393
|
+
in: header
|
1394
|
+
externalDocs:
|
1395
|
+
description: Find out more about Swagger
|
1396
|
+
url: http://swagger.io
|