open_api-loader 0.0.1

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.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +15 -0
  3. data/.gitignore +13 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +28 -0
  6. data/.travis.yml +24 -0
  7. data/CHANGELOG.md +10 -0
  8. data/Gemfile +8 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +99 -0
  11. data/Rakefile +10 -0
  12. data/bin/console +6 -0
  13. data/bin/setup +6 -0
  14. data/lib/open_api-loader.rb +1 -0
  15. data/lib/open_api/loader.rb +44 -0
  16. data/lib/open_api/loader/collector.rb +61 -0
  17. data/lib/open_api/loader/denormalizer.rb +27 -0
  18. data/lib/open_api/loader/denormalizer/parameters.rb +46 -0
  19. data/lib/open_api/loader/denormalizer/security.rb +35 -0
  20. data/lib/open_api/loader/denormalizer/servers.rb +36 -0
  21. data/lib/open_api/loader/denormalizer/variables.rb +54 -0
  22. data/lib/open_api/loader/reader.rb +47 -0
  23. data/lib/open_api/loader/ref.rb +85 -0
  24. data/lib/open_api/loader/translator.rb +50 -0
  25. data/lib/open_api/loader/translator/clean_definitions.rb +16 -0
  26. data/lib/open_api/loader/translator/convert_bodies.rb +77 -0
  27. data/lib/open_api/loader/translator/convert_forms.rb +71 -0
  28. data/lib/open_api/loader/translator/convert_parameters.rb +135 -0
  29. data/lib/open_api/loader/translator/convert_responses.rb +63 -0
  30. data/lib/open_api/loader/translator/convert_security_schemes.rb +49 -0
  31. data/lib/open_api/loader/translator/convert_servers.rb +46 -0
  32. data/lib/open_api/loader/translator/convert_version.rb +12 -0
  33. data/lib/open_api/loader/translator/denormalize_consumes.rb +44 -0
  34. data/lib/open_api/loader/translator/denormalize_parameters.rb +55 -0
  35. data/lib/open_api/loader/translator/denormalize_produces.rb +53 -0
  36. data/open_api-loader.gemspec +25 -0
  37. data/spec/fixtures/oas2/collected.yaml +1012 -0
  38. data/spec/fixtures/oas2/denormalized.yaml +1462 -0
  39. data/spec/fixtures/oas2/loaded.yaml +564 -0
  40. data/spec/fixtures/oas2/models.yaml +118 -0
  41. data/spec/fixtures/oas2/source.json +1 -0
  42. data/spec/fixtures/oas2/source.yaml +569 -0
  43. data/spec/fixtures/oas2/translated.yaml +1396 -0
  44. data/spec/fixtures/oas3/collected.yaml +233 -0
  45. data/spec/fixtures/oas3/denormalized.yaml +233 -0
  46. data/spec/fixtures/oas3/source.json +1 -0
  47. data/spec/fixtures/oas3/source.yaml +217 -0
  48. data/spec/loader_spec.rb +53 -0
  49. data/spec/spec_helper.rb +17 -0
  50. data/spec/support/fixture_helpers.rb +18 -0
  51. data/spec/support/path_helpers.rb +27 -0
  52. data/spec/unit/collector_spec.rb +31 -0
  53. data/spec/unit/denormalizer_spec.rb +17 -0
  54. data/spec/unit/reader_spec.rb +53 -0
  55. data/spec/unit/ref_spec.rb +107 -0
  56. data/spec/unit/translator_spec.rb +15 -0
  57. metadata +232 -0
@@ -0,0 +1,25 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.name = "open_api-loader"
3
+ gem.version = "0.0.1"
4
+ gem.author = "Andrew Kozin (nepalez)"
5
+ gem.email = "andrew.kozin@gmail.com"
6
+ gem.homepage = "https://github.com/nepalez/open_api-loader"
7
+ gem.summary = "Loads OAS scheme and updates it to OAS3 standard"
8
+ gem.license = "MIT"
9
+
10
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
11
+ gem.test_files = gem.files.grep(/^spec/)
12
+ gem.extra_rdoc_files = Dir["README.md", "LICENSE", "CHANGELOG.md"]
13
+
14
+ gem.required_ruby_version = "~> 2.3"
15
+
16
+ gem.add_runtime_dependency "dry-initializer", "~> 2.4"
17
+ gem.add_runtime_dependency "constructor_shortcut", "~> 0.3"
18
+
19
+ gem.add_development_dependency "inch", "~> 0.8"
20
+ gem.add_development_dependency "rake", "> 10"
21
+ gem.add_development_dependency "rspec", "~> 3.0"
22
+ gem.add_development_dependency "rspec-its", "~> 1.2"
23
+ gem.add_development_dependency "rubocop", "~> 0.55"
24
+ gem.add_development_dependency "webmock", "~> 3.4"
25
+ end
@@ -0,0 +1,1012 @@
1
+ ---
2
+ swagger: '2.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
+ host: petstore.swagger.io
16
+ basePath: "/v2"
17
+ tags:
18
+ - name: pet
19
+ description: Everything about your Pets
20
+ externalDocs:
21
+ description: Find out more
22
+ url: http://swagger.io
23
+ - name: store
24
+ description: Access to Petstore orders
25
+ - name: user
26
+ description: Operations about user
27
+ externalDocs:
28
+ description: Find out more about our store
29
+ url: http://swagger.io
30
+ schemes:
31
+ - http
32
+ consumes:
33
+ - application/json
34
+ - application/xml
35
+ produces:
36
+ - application/xml
37
+ - application/json
38
+ paths:
39
+ "/pet":
40
+ post:
41
+ tags:
42
+ - pet
43
+ summary: Add a new pet to the store
44
+ description: ''
45
+ operationId: addPet
46
+ parameters:
47
+ - in: body
48
+ name: body
49
+ description: Pet object that needs to be added to the store
50
+ required: true
51
+ schema:
52
+ type: object
53
+ required:
54
+ - name
55
+ - photoUrls
56
+ properties:
57
+ id:
58
+ type: integer
59
+ format: int64
60
+ category:
61
+ type: object
62
+ properties:
63
+ id:
64
+ type: integer
65
+ format: int64
66
+ name:
67
+ type: string
68
+ xml:
69
+ name: Category
70
+ name:
71
+ type: string
72
+ example: doggie
73
+ photoUrls:
74
+ type: array
75
+ xml:
76
+ name: photoUrl
77
+ wrapped: true
78
+ items:
79
+ type: string
80
+ tags:
81
+ type: array
82
+ xml:
83
+ name: tag
84
+ wrapped: true
85
+ items:
86
+ type: object
87
+ properties:
88
+ id:
89
+ type: integer
90
+ format: int64
91
+ name:
92
+ type: string
93
+ xml:
94
+ name: Tag
95
+ status:
96
+ type: string
97
+ description: pet status in the store
98
+ enum:
99
+ - available
100
+ - pending
101
+ - sold
102
+ xml:
103
+ name: Pet
104
+ responses:
105
+ '405':
106
+ description: Invalid input
107
+ security:
108
+ - petstore_auth:
109
+ - write:pets
110
+ - read:pets
111
+ put:
112
+ tags:
113
+ - pet
114
+ summary: Update an existing pet
115
+ description: ''
116
+ operationId: updatePet
117
+ parameters:
118
+ - in: body
119
+ name: body
120
+ description: Pet object that needs to be added to the store
121
+ required: true
122
+ schema:
123
+ type: object
124
+ required:
125
+ - name
126
+ - photoUrls
127
+ properties:
128
+ id:
129
+ type: integer
130
+ format: int64
131
+ category:
132
+ type: object
133
+ properties:
134
+ id:
135
+ type: integer
136
+ format: int64
137
+ name:
138
+ type: string
139
+ xml:
140
+ name: Category
141
+ name:
142
+ type: string
143
+ example: doggie
144
+ photoUrls:
145
+ type: array
146
+ xml:
147
+ name: photoUrl
148
+ wrapped: true
149
+ items:
150
+ type: string
151
+ tags:
152
+ type: array
153
+ xml:
154
+ name: tag
155
+ wrapped: true
156
+ items:
157
+ type: object
158
+ properties:
159
+ id:
160
+ type: integer
161
+ format: int64
162
+ name:
163
+ type: string
164
+ xml:
165
+ name: Tag
166
+ status:
167
+ type: string
168
+ description: pet status in the store
169
+ enum:
170
+ - available
171
+ - pending
172
+ - sold
173
+ xml:
174
+ name: Pet
175
+ responses:
176
+ '400':
177
+ description: Invalid ID supplied
178
+ '404':
179
+ description: Pet not found
180
+ '405':
181
+ description: Validators exception
182
+ security:
183
+ - petstore_auth:
184
+ - write:pets
185
+ - read:pets
186
+ "/pet/findByStatus":
187
+ get:
188
+ tags:
189
+ - pet
190
+ summary: Finds Pets by status
191
+ description: Multiple status values can be provided with comma separated strings
192
+ operationId: findPetsByStatus
193
+ produces:
194
+ - application/xml
195
+ - application/json
196
+ parameters:
197
+ - name: status
198
+ in: query
199
+ description: Status values that need to be considered for filter
200
+ required: true
201
+ type: array
202
+ items:
203
+ type: string
204
+ enum:
205
+ - available
206
+ - pending
207
+ - sold
208
+ default: available
209
+ collectionFormat: multi
210
+ responses:
211
+ '200':
212
+ description: successful operation
213
+ schema:
214
+ type: array
215
+ items:
216
+ type: object
217
+ required:
218
+ - name
219
+ - photoUrls
220
+ properties:
221
+ id:
222
+ type: integer
223
+ format: int64
224
+ category:
225
+ type: object
226
+ properties:
227
+ id:
228
+ type: integer
229
+ format: int64
230
+ name:
231
+ type: string
232
+ xml:
233
+ name: Category
234
+ name:
235
+ type: string
236
+ example: doggie
237
+ photoUrls:
238
+ type: array
239
+ xml:
240
+ name: photoUrl
241
+ wrapped: true
242
+ items:
243
+ type: string
244
+ tags:
245
+ type: array
246
+ xml:
247
+ name: tag
248
+ wrapped: true
249
+ items:
250
+ type: object
251
+ properties:
252
+ id:
253
+ type: integer
254
+ format: int64
255
+ name:
256
+ type: string
257
+ xml:
258
+ name: Tag
259
+ status:
260
+ type: string
261
+ description: pet status in the store
262
+ enum:
263
+ - available
264
+ - pending
265
+ - sold
266
+ xml:
267
+ name: Pet
268
+ '400':
269
+ description: Invalid status value
270
+ security:
271
+ - petstore_auth:
272
+ - write:pets
273
+ - read:pets
274
+ "/pet/findByTags":
275
+ get:
276
+ tags:
277
+ - pet
278
+ summary: Finds Pets by tags
279
+ description: Muliple tags can be provided with comma separated strings. Use tag1,
280
+ tag2, tag3 for testing.
281
+ operationId: findPetsByTags
282
+ produces:
283
+ - application/xml
284
+ - application/json
285
+ parameters:
286
+ - name: tags
287
+ in: query
288
+ description: Tags to filter by
289
+ required: true
290
+ type: array
291
+ items:
292
+ type: string
293
+ collectionFormat: multi
294
+ responses:
295
+ '200':
296
+ description: successful operation
297
+ schema:
298
+ type: array
299
+ items:
300
+ type: object
301
+ required:
302
+ - name
303
+ - photoUrls
304
+ properties:
305
+ id:
306
+ type: integer
307
+ format: int64
308
+ category:
309
+ type: object
310
+ properties:
311
+ id:
312
+ type: integer
313
+ format: int64
314
+ name:
315
+ type: string
316
+ xml:
317
+ name: Category
318
+ name:
319
+ type: string
320
+ example: doggie
321
+ photoUrls:
322
+ type: array
323
+ xml:
324
+ name: photoUrl
325
+ wrapped: true
326
+ items:
327
+ type: string
328
+ tags:
329
+ type: array
330
+ xml:
331
+ name: tag
332
+ wrapped: true
333
+ items:
334
+ type: object
335
+ properties:
336
+ id:
337
+ type: integer
338
+ format: int64
339
+ name:
340
+ type: string
341
+ xml:
342
+ name: Tag
343
+ status:
344
+ type: string
345
+ description: pet status in the store
346
+ enum:
347
+ - available
348
+ - pending
349
+ - sold
350
+ xml:
351
+ name: Pet
352
+ '400':
353
+ description: Invalid tag value
354
+ security:
355
+ - petstore_auth:
356
+ - write:pets
357
+ - read:pets
358
+ deprecated: true
359
+ "/pet/{petId}":
360
+ parameters:
361
+ - name: petId
362
+ in: path
363
+ description: ID of pet
364
+ required: true
365
+ type: integer
366
+ format: int64
367
+ get:
368
+ tags:
369
+ - pet
370
+ summary: Find pet by ID
371
+ description: Returns a single pet
372
+ operationId: getPetById
373
+ produces:
374
+ - application/xml
375
+ - application/json
376
+ responses:
377
+ '200':
378
+ description: successful operation
379
+ schema:
380
+ type: object
381
+ required:
382
+ - name
383
+ - photoUrls
384
+ properties:
385
+ id:
386
+ type: integer
387
+ format: int64
388
+ category:
389
+ type: object
390
+ properties:
391
+ id:
392
+ type: integer
393
+ format: int64
394
+ name:
395
+ type: string
396
+ xml:
397
+ name: Category
398
+ name:
399
+ type: string
400
+ example: doggie
401
+ photoUrls:
402
+ type: array
403
+ xml:
404
+ name: photoUrl
405
+ wrapped: true
406
+ items:
407
+ type: string
408
+ tags:
409
+ type: array
410
+ xml:
411
+ name: tag
412
+ wrapped: true
413
+ items:
414
+ type: object
415
+ properties:
416
+ id:
417
+ type: integer
418
+ format: int64
419
+ name:
420
+ type: string
421
+ xml:
422
+ name: Tag
423
+ status:
424
+ type: string
425
+ description: pet status in the store
426
+ enum:
427
+ - available
428
+ - pending
429
+ - sold
430
+ xml:
431
+ name: Pet
432
+ '400':
433
+ description: Invalid ID supplied
434
+ '404':
435
+ description: Pet not found
436
+ security:
437
+ - api_key: []
438
+ post:
439
+ tags:
440
+ - pet
441
+ summary: Updates a pet in the store with form data
442
+ description: ''
443
+ operationId: updatePetWithForm
444
+ consumes:
445
+ - application/x-www-form-urlencoded
446
+ parameters:
447
+ - name: name
448
+ in: formData
449
+ description: Updated name of the pet
450
+ required: false
451
+ type: string
452
+ - name: status
453
+ in: formData
454
+ description: Updated status of the pet
455
+ required: false
456
+ type: string
457
+ responses:
458
+ '405':
459
+ description: Invalid input
460
+ security:
461
+ - petstore_auth:
462
+ - write:pets
463
+ - read:pets
464
+ delete:
465
+ tags:
466
+ - pet
467
+ summary: Deletes a pet
468
+ description: ''
469
+ operationId: deletePet
470
+ produces:
471
+ - application/xml
472
+ - application/json
473
+ parameters:
474
+ - name: api_key
475
+ in: header
476
+ required: false
477
+ type: string
478
+ responses:
479
+ '400':
480
+ description: Invalid ID supplied
481
+ '404':
482
+ description: Pet not found
483
+ security:
484
+ - petstore_auth:
485
+ - write:pets
486
+ - read:pets
487
+ "/pet/{petId}/uploadImage":
488
+ parameters:
489
+ - name: petId
490
+ in: path
491
+ description: ID of pet
492
+ required: true
493
+ type: integer
494
+ format: int64
495
+ post:
496
+ tags:
497
+ - pet
498
+ summary: uploads an image
499
+ description: ''
500
+ operationId: uploadFile
501
+ consumes:
502
+ - multipart/form-data
503
+ produces:
504
+ - application/json
505
+ parameters:
506
+ - name: additionalMetadata
507
+ in: formData
508
+ description: Additional data to pass to server
509
+ required: false
510
+ type: string
511
+ - name: file
512
+ in: formData
513
+ description: file to upload
514
+ required: false
515
+ type: file
516
+ responses:
517
+ '200':
518
+ description: successful operation
519
+ schema:
520
+ type: object
521
+ properties:
522
+ code:
523
+ type: integer
524
+ format: int32
525
+ type:
526
+ type: string
527
+ message:
528
+ type: string
529
+ security:
530
+ - petstore_auth:
531
+ - write:pets
532
+ - read:pets
533
+ "/store/inventory":
534
+ get:
535
+ tags:
536
+ - store
537
+ summary: Returns pet inventories by status
538
+ description: Returns a map of status codes to quantities
539
+ operationId: getInventory
540
+ produces:
541
+ - application/json
542
+ parameters: []
543
+ responses:
544
+ '200':
545
+ description: successful operation
546
+ schema:
547
+ type: object
548
+ additionalProperties:
549
+ type: integer
550
+ format: int32
551
+ security:
552
+ - api_key: []
553
+ "/store/order":
554
+ post:
555
+ tags:
556
+ - store
557
+ summary: Place an order for a pet
558
+ description: ''
559
+ operationId: placeOrder
560
+ produces:
561
+ - application/xml
562
+ - application/json
563
+ parameters:
564
+ - in: body
565
+ name: body
566
+ description: order placed for purchasing the pet
567
+ required: true
568
+ schema:
569
+ type: object
570
+ properties:
571
+ id:
572
+ type: integer
573
+ format: int64
574
+ petId:
575
+ type: integer
576
+ format: int64
577
+ quantity:
578
+ type: integer
579
+ format: int32
580
+ shipDate:
581
+ type: string
582
+ format: date-time
583
+ status:
584
+ type: string
585
+ description: Order Status
586
+ enum:
587
+ - placed
588
+ - approved
589
+ - delivered
590
+ complete:
591
+ type: boolean
592
+ default: false
593
+ xml:
594
+ name: Order
595
+ responses:
596
+ '200':
597
+ description: successful operation
598
+ schema:
599
+ type: object
600
+ properties:
601
+ id:
602
+ type: integer
603
+ format: int64
604
+ petId:
605
+ type: integer
606
+ format: int64
607
+ quantity:
608
+ type: integer
609
+ format: int32
610
+ shipDate:
611
+ type: string
612
+ format: date-time
613
+ status:
614
+ type: string
615
+ description: Order Status
616
+ enum:
617
+ - placed
618
+ - approved
619
+ - delivered
620
+ complete:
621
+ type: boolean
622
+ default: false
623
+ xml:
624
+ name: Order
625
+ '400':
626
+ description: Invalid Order
627
+ "/store/order/{orderId}":
628
+ parameters:
629
+ - name: "orderId"
630
+ in: "path"
631
+ description: ID of purchase order
632
+ required: true
633
+ type: "integer"
634
+ maximum: 10.0
635
+ minimum: 1.0
636
+ format: "int64"
637
+ get:
638
+ tags:
639
+ - store
640
+ summary: Find purchase order by ID
641
+ description: For valid response try integer IDs with value >= 1 and <= 10. Other
642
+ values will generated exceptions
643
+ operationId: getOrderById
644
+ produces:
645
+ - application/xml
646
+ - application/json
647
+ responses:
648
+ '200':
649
+ description: successful operation
650
+ schema:
651
+ type: object
652
+ properties:
653
+ id:
654
+ type: integer
655
+ format: int64
656
+ petId:
657
+ type: integer
658
+ format: int64
659
+ quantity:
660
+ type: integer
661
+ format: int32
662
+ shipDate:
663
+ type: string
664
+ format: date-time
665
+ status:
666
+ type: string
667
+ description: Order Status
668
+ enum:
669
+ - placed
670
+ - approved
671
+ - delivered
672
+ complete:
673
+ type: boolean
674
+ default: false
675
+ xml:
676
+ name: Order
677
+ '400':
678
+ description: Invalid ID supplied
679
+ '404':
680
+ description: Order not found
681
+ delete:
682
+ tags:
683
+ - store
684
+ summary: Delete purchase order by ID
685
+ description: For valid response try integer IDs with positive integer value. Negative
686
+ or non-integer values will generate API errors
687
+ operationId: deleteOrder
688
+ produces:
689
+ - application/xml
690
+ - application/json
691
+ responses:
692
+ '400':
693
+ description: Invalid ID supplied
694
+ '404':
695
+ description: Order not found
696
+ "/user":
697
+ post:
698
+ tags:
699
+ - user
700
+ summary: Create user
701
+ description: This can only be done by the logged in user.
702
+ operationId: createUser
703
+ produces:
704
+ - application/xml
705
+ - application/json
706
+ parameters:
707
+ - in: body
708
+ name: body
709
+ description: Created user object
710
+ required: true
711
+ schema:
712
+ type: object
713
+ properties:
714
+ id:
715
+ type: integer
716
+ format: int64
717
+ username:
718
+ type: string
719
+ firstName:
720
+ type: string
721
+ lastName:
722
+ type: string
723
+ email:
724
+ type: string
725
+ password:
726
+ type: string
727
+ phone:
728
+ type: string
729
+ userStatus:
730
+ type: integer
731
+ format: int32
732
+ description: User Status
733
+ xml:
734
+ name: User
735
+ responses:
736
+ default:
737
+ description: successful operation
738
+ "/user/createWithArray":
739
+ post:
740
+ tags:
741
+ - user
742
+ summary: Creates list of users with given input array
743
+ description: ''
744
+ operationId: createUsersWithArrayInput
745
+ produces:
746
+ - application/xml
747
+ - application/json
748
+ parameters:
749
+ - in: body
750
+ name: body
751
+ description: List of user object
752
+ required: true
753
+ schema:
754
+ type: array
755
+ items:
756
+ type: object
757
+ properties:
758
+ id:
759
+ type: integer
760
+ format: int64
761
+ username:
762
+ type: string
763
+ firstName:
764
+ type: string
765
+ lastName:
766
+ type: string
767
+ email:
768
+ type: string
769
+ password:
770
+ type: string
771
+ phone:
772
+ type: string
773
+ userStatus:
774
+ type: integer
775
+ format: int32
776
+ description: User Status
777
+ xml:
778
+ name: User
779
+ responses:
780
+ default:
781
+ description: successful operation
782
+ "/user/createWithList":
783
+ post:
784
+ tags:
785
+ - user
786
+ summary: Creates list of users with given input array
787
+ description: ''
788
+ operationId: createUsersWithListInput
789
+ produces:
790
+ - application/xml
791
+ - application/json
792
+ parameters:
793
+ - in: body
794
+ name: body
795
+ description: List of user object
796
+ required: true
797
+ schema:
798
+ type: array
799
+ items:
800
+ type: object
801
+ properties:
802
+ id:
803
+ type: integer
804
+ format: int64
805
+ username:
806
+ type: string
807
+ firstName:
808
+ type: string
809
+ lastName:
810
+ type: string
811
+ email:
812
+ type: string
813
+ password:
814
+ type: string
815
+ phone:
816
+ type: string
817
+ userStatus:
818
+ type: integer
819
+ format: int32
820
+ description: User Status
821
+ xml:
822
+ name: User
823
+ responses:
824
+ default:
825
+ description: successful operation
826
+ "/user/login":
827
+ get:
828
+ tags:
829
+ - user
830
+ summary: Logs user into the system
831
+ description: ''
832
+ operationId: loginUser
833
+ produces:
834
+ - application/xml
835
+ - application/json
836
+ parameters:
837
+ - name: username
838
+ in: query
839
+ description: The user name for login
840
+ required: true
841
+ type: string
842
+ - name: password
843
+ in: query
844
+ description: The password for login in clear text
845
+ required: true
846
+ type: string
847
+ responses:
848
+ '200':
849
+ description: successful operation
850
+ schema:
851
+ type: string
852
+ headers:
853
+ X-Rate-Limit:
854
+ type: integer
855
+ format: int32
856
+ description: calls per hour allowed by the user
857
+ X-Expires-After:
858
+ type: string
859
+ format: date-time
860
+ description: date in UTC when token expires
861
+ '400':
862
+ description: Invalid username/password supplied
863
+ "/user/logout":
864
+ get:
865
+ tags:
866
+ - user
867
+ summary: Logs out current logged in user session
868
+ description: ''
869
+ operationId: logoutUser
870
+ produces:
871
+ - application/xml
872
+ - application/json
873
+ parameters: []
874
+ responses:
875
+ default:
876
+ description: successful operation
877
+ "/user/{username}":
878
+ parameters:
879
+ - name: username
880
+ in: path
881
+ description: 'The name of the user. Use user1 for testing. '
882
+ required: true
883
+ type: string
884
+ get:
885
+ tags:
886
+ - user
887
+ summary: Get user by user name
888
+ description: ''
889
+ operationId: getUserByName
890
+ produces:
891
+ - application/xml
892
+ - application/json
893
+ responses:
894
+ '200':
895
+ description: successful operation
896
+ schema:
897
+ type: object
898
+ properties:
899
+ id:
900
+ type: integer
901
+ format: int64
902
+ username:
903
+ type: string
904
+ firstName:
905
+ type: string
906
+ lastName:
907
+ type: string
908
+ email:
909
+ type: string
910
+ password:
911
+ type: string
912
+ phone:
913
+ type: string
914
+ userStatus:
915
+ type: integer
916
+ format: int32
917
+ description: User Status
918
+ xml:
919
+ name: User
920
+ '400':
921
+ description: Invalid username supplied
922
+ '404':
923
+ description: User not found
924
+ put:
925
+ tags:
926
+ - user
927
+ summary: Updated user
928
+ description: This can only be done by the logged in user.
929
+ operationId: updateUser
930
+ produces:
931
+ - application/xml
932
+ - application/json
933
+ parameters:
934
+ - in: body
935
+ name: body
936
+ description: Updated user object
937
+ required: true
938
+ schema:
939
+ type: object
940
+ properties:
941
+ id:
942
+ type: integer
943
+ format: int64
944
+ username:
945
+ type: string
946
+ firstName:
947
+ type: string
948
+ lastName:
949
+ type: string
950
+ email:
951
+ type: string
952
+ password:
953
+ type: string
954
+ phone:
955
+ type: string
956
+ userStatus:
957
+ type: integer
958
+ format: int32
959
+ description: User Status
960
+ xml:
961
+ name: User
962
+ responses:
963
+ '400':
964
+ description: Invalid user supplied
965
+ '404':
966
+ description: User not found
967
+ delete:
968
+ tags:
969
+ - user
970
+ summary: Delete user
971
+ description: This can only be done by the logged in user.
972
+ operationId: deleteUser
973
+ parameters:
974
+ - name: username
975
+ in: path
976
+ description: 'The name of the user to be deleted. '
977
+ required: true
978
+ type: string
979
+ produces:
980
+ - application/xml
981
+ - application/json
982
+ responses:
983
+ '400':
984
+ description: Invalid username supplied
985
+ '404':
986
+ description: User not found
987
+ securityDefinitions:
988
+ petstore_auth:
989
+ type: oauth2
990
+ authorizationUrl: http://petstore.swagger.io/oauth/dialog
991
+ flow: implicit
992
+ scopes:
993
+ write:pets: modify pets in your account
994
+ read:pets: read your pets
995
+ api_key:
996
+ type: apiKey
997
+ name: api_key
998
+ in: header
999
+ definitions:
1000
+ ApiResponse:
1001
+ type: object
1002
+ properties:
1003
+ code:
1004
+ type: integer
1005
+ format: int32
1006
+ type:
1007
+ type: string
1008
+ message:
1009
+ type: string
1010
+ externalDocs:
1011
+ description: Find out more about Swagger
1012
+ url: http://swagger.io