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