1{ 2 "swagger": "2.0", 3 "info": { 4 "version": "1.0.0", 5 "title": "Swagger Petstore", 6 "license": { 7 "name": "MIT" 8 } 9 }, 10 "host": "petstore.swagger.io", 11 "basePath": "/v1", 12 "schemes": [ 13 "http" 14 ], 15 "consumes": [ 16 "application/json" 17 ], 18 "produces": [ 19 "application/json" 20 ], 21 "paths": { 22 "/pets": { 23 "get": { 24 "summary": "List all pets", 25 "operationId": "listPets", 26 "tags": [ 27 "pets" 28 ], 29 "parameters": [ 30 { 31 "name": "limit", 32 "in": "query", 33 "description": "How many items to return at one time (max 100)", 34 "required": false, 35 "type": "integer", 36 "format": "int32" 37 } 38 ], 39 "responses": { 40 "200": { 41 "description": "An paged array of pets", 42 "headers": { 43 "x-next": { 44 "type": "string", 45 "description": "A link to the next page of responses" 46 } 47 }, 48 "schema": { 49 "$ref": "#/definitions/Pets" 50 } 51 }, 52 "default": { 53 "description": "unexpected error", 54 "schema": { 55 "$ref": "#/definitions/Error" 56 } 57 } 58 } 59 }, 60 "post": { 61 "summary": "Create a pet", 62 "operationId": "createPets", 63 "tags": [ 64 "pets" 65 ], 66 "responses": { 67 "201": { 68 "description": "Null response" 69 }, 70 "default": { 71 "description": "unexpected error", 72 "schema": { 73 "$ref": "#/definitions/Error" 74 } 75 } 76 } 77 } 78 }, 79 "/pets/{petId}": { 80 "get": { 81 "summary": "Info for a specific pet", 82 "operationId": "showPetById", 83 "tags": [ 84 "pets" 85 ], 86 "parameters": [ 87 { 88 "name": "petId", 89 "in": "path", 90 "required": true, 91 "description": "The id of the pet to retrieve", 92 "type": "string" 93 } 94 ], 95 "responses": { 96 "200": { 97 "description": "Expected response to a valid request", 98 "schema": { 99 "$ref": "#/definitions/Pets" 100 } 101 }, 102 "default": { 103 "description": "unexpected error", 104 "schema": { 105 "$ref": "#/definitions/Error" 106 } 107 } 108 } 109 } 110 } 111 }, 112 "definitions": { 113 "Pet": { 114 "required": [ 115 "id", 116 "name" 117 ], 118 "properties": { 119 "id": { 120 "type": "integer", 121 "format": "int64" 122 }, 123 "name": { 124 "type": "string" 125 }, 126 "tag": { 127 "type": "string" 128 } 129 } 130 }, 131 "Pets": { 132 "type": "array", 133 "items": { 134 "$ref": "#/definitions/Pet" 135 } 136 }, 137 "Error": { 138 "required": [ 139 "code", 140 "message" 141 ], 142 "properties": { 143 "code": { 144 "type": "integer", 145 "format": "int32" 146 }, 147 "message": { 148 "type": "string" 149 } 150 } 151 } 152 } 153}