swagger_parser 0.0.1

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