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