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