1{ 2 "swagger": "2.0", 3 "info": { 4 "version": "2017-10-18T18:35:07Z", 5 "title": "PetStore" 6 }, 7 "basePath": "/Alpha", 8 "schemes": [ 9 "https" 10 ], 11 "paths": { 12 "/": { 13 "get": { 14 "consumes": [ 15 "application/json" 16 ], 17 "produces": [ 18 "text/html" 19 ], 20 "responses": { 21 "200": { 22 "description": "200 response", 23 "headers": { 24 "Content-Type": { 25 "type": "string" 26 } 27 } 28 } 29 }, 30 "x-amazon-apigateway-integration": { 31 "responses": { 32 "default": { 33 "statusCode": "200", 34 "responseParameters": { 35 "method.response.header.Content-Type": "'text/html'" 36 }, 37 "responseTemplates": { 38 "text/html": "<html>\n <head>\n <style>\n body {\n color: #333;\n font-family: Sans-serif;\n max-width: 800px;\n margin: auto;\n }\n </style>\n </head>\n <body>\n <h1>Welcome to your Pet Store API</h1>\n <p>\n You have succesfully deployed your first API. You are seeing this HTML page because the <code>GET</code> method to the root resource of your API returns this content as a Mock integration.\n </p>\n <p>\n The Pet Store API contains the <code>/pets</code> and <code>/pets/{petId}</code> resources. By making a <a href=\"/$context.stage/pets/\" target=\"_blank\"><code>GET</code> request</a> to <code>/pets</code> you can retrieve a list of Pets in your API. If you are looking for a specific pet, for example the pet with ID 1, you can make a <a href=\"/$context.stage/pets/1\" target=\"_blank\"><code>GET</code> request</a> to <code>/pets/1</code>.\n </p>\n <p>\n You can use a REST client such as <a href=\"https://www.getpostman.com/\" target=\"_blank\">Postman</a> to test the <code>POST</code> methods in your API to create a new pet. Use the sample body below to send the <code>POST</code> request:\n </p>\n <pre>\n{\n \"type\" : \"cat\",\n \"price\" : 123.11\n}\n </pre>\n </body>\n</html>" 39 } 40 } 41 }, 42 "passthroughBehavior": "when_no_match", 43 "requestTemplates": { 44 "application/json": "{\"statusCode\": 200}" 45 }, 46 "type": "mock" 47 } 48 } 49 }, 50 "/pets": { 51 "get": { 52 "produces": [ 53 "application/json" 54 ], 55 "parameters": [ 56 { 57 "name": "type", 58 "in": "query", 59 "required": false, 60 "type": "string" 61 }, 62 { 63 "name": "page", 64 "in": "query", 65 "required": false, 66 "type": "string" 67 } 68 ], 69 "responses": { 70 "200": { 71 "description": "200 response", 72 "schema": { 73 "$ref": "#/definitions/Pets" 74 }, 75 "headers": { 76 "Access-Control-Allow-Origin": { 77 "type": "string" 78 } 79 } 80 } 81 }, 82 "x-amazon-apigateway-integration": { 83 "uri": "http://petstore-demo-endpoint.execute-api.com/petstore/pets", 84 "responses": { 85 "default": { 86 "statusCode": "200", 87 "responseParameters": { 88 "method.response.header.Access-Control-Allow-Origin": "'*'" 89 } 90 } 91 }, 92 "requestParameters": { 93 "integration.request.querystring.page": "method.request.querystring.page", 94 "integration.request.querystring.type": "method.request.querystring.type" 95 }, 96 "passthroughBehavior": "when_no_match", 97 "httpMethod": "GET", 98 "type": "http" 99 } 100 }, 101 "post": { 102 "operationId": "CreatePet", 103 "consumes": [ 104 "application/json" 105 ], 106 "produces": [ 107 "application/json" 108 ], 109 "parameters": [ 110 { 111 "in": "body", 112 "name": "NewPet", 113 "required": true, 114 "schema": { 115 "$ref": "#/definitions/NewPet" 116 } 117 } 118 ], 119 "responses": { 120 "200": { 121 "description": "200 response", 122 "schema": { 123 "$ref": "#/definitions/NewPetResponse" 124 }, 125 "headers": { 126 "Access-Control-Allow-Origin": { 127 "type": "string" 128 } 129 } 130 } 131 }, 132 "x-amazon-apigateway-integration": { 133 "uri": "http://petstore-demo-endpoint.execute-api.com/petstore/pets", 134 "responses": { 135 "default": { 136 "statusCode": "200", 137 "responseParameters": { 138 "method.response.header.Access-Control-Allow-Origin": "'*'" 139 } 140 } 141 }, 142 "passthroughBehavior": "when_no_match", 143 "httpMethod": "POST", 144 "type": "http" 145 } 146 }, 147 "options": { 148 "consumes": [ 149 "application/json" 150 ], 151 "produces": [ 152 "application/json" 153 ], 154 "responses": { 155 "200": { 156 "description": "200 response", 157 "schema": { 158 "$ref": "#/definitions/Empty" 159 }, 160 "headers": { 161 "Access-Control-Allow-Origin": { 162 "type": "string" 163 }, 164 "Access-Control-Allow-Methods": { 165 "type": "string" 166 }, 167 "Access-Control-Allow-Headers": { 168 "type": "string" 169 } 170 } 171 } 172 }, 173 "x-amazon-apigateway-integration": { 174 "responses": { 175 "default": { 176 "statusCode": "200", 177 "responseParameters": { 178 "method.response.header.Access-Control-Allow-Methods": "'POST,GET,OPTIONS'", 179 "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'", 180 "method.response.header.Access-Control-Allow-Origin": "'*'" 181 } 182 } 183 }, 184 "passthroughBehavior": "when_no_match", 185 "requestTemplates": { 186 "application/json": "{\"statusCode\": 200}" 187 }, 188 "type": "mock" 189 } 190 } 191 }, 192 "/pets/{petId}": { 193 "get": { 194 "operationId": "GetPet", 195 "produces": [ 196 "application/json" 197 ], 198 "parameters": [ 199 { 200 "name": "petId", 201 "in": "path", 202 "required": true, 203 "type": "string" 204 } 205 ], 206 "responses": { 207 "200": { 208 "description": "200 response", 209 "schema": { 210 "$ref": "#/definitions/Pet" 211 }, 212 "headers": { 213 "Access-Control-Allow-Origin": { 214 "type": "string" 215 } 216 } 217 } 218 }, 219 "x-amazon-apigateway-integration": { 220 "uri": "http://petstore-demo-endpoint.execute-api.com/petstore/pets/{petId}", 221 "responses": { 222 "default": { 223 "statusCode": "200", 224 "responseParameters": { 225 "method.response.header.Access-Control-Allow-Origin": "'*'" 226 } 227 } 228 }, 229 "requestParameters": { 230 "integration.request.path.petId": "method.request.path.petId" 231 }, 232 "passthroughBehavior": "when_no_match", 233 "httpMethod": "GET", 234 "type": "http" 235 } 236 }, 237 "options": { 238 "consumes": [ 239 "application/json" 240 ], 241 "produces": [ 242 "application/json" 243 ], 244 "parameters": [ 245 { 246 "name": "petId", 247 "in": "path", 248 "required": true, 249 "type": "string" 250 } 251 ], 252 "responses": { 253 "200": { 254 "description": "200 response", 255 "schema": { 256 "$ref": "#/definitions/Empty" 257 }, 258 "headers": { 259 "Access-Control-Allow-Origin": { 260 "type": "string" 261 }, 262 "Access-Control-Allow-Methods": { 263 "type": "string" 264 }, 265 "Access-Control-Allow-Headers": { 266 "type": "string" 267 } 268 } 269 } 270 }, 271 "x-amazon-apigateway-integration": { 272 "responses": { 273 "default": { 274 "statusCode": "200", 275 "responseParameters": { 276 "method.response.header.Access-Control-Allow-Methods": "'GET,OPTIONS'", 277 "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'", 278 "method.response.header.Access-Control-Allow-Origin": "'*'" 279 } 280 } 281 }, 282 "passthroughBehavior": "when_no_match", 283 "requestTemplates": { 284 "application/json": "{\"statusCode\": 200}" 285 }, 286 "type": "mock" 287 } 288 } 289 } 290 }, 291 "definitions": { 292 "Pets": { 293 "type": "array", 294 "items": { 295 "$ref": "#/definitions/Pet" 296 } 297 }, 298 "Empty": { 299 "type": "object" 300 }, 301 "NewPetResponse": { 302 "type": "object", 303 "properties": { 304 "pet": { 305 "$ref": "#/definitions/Pet" 306 }, 307 "message": { 308 "type": "string" 309 } 310 } 311 }, 312 "Pet": { 313 "type": "object", 314 "properties": { 315 "id": { 316 "type": "string" 317 }, 318 "type": { 319 "type": "string" 320 }, 321 "price": { 322 "type": "number" 323 } 324 } 325 }, 326 "NewPet": { 327 "type": "object", 328 "properties": { 329 "type": { 330 "$ref": "#/definitions/PetType" 331 }, 332 "price": { 333 "type": "number" 334 } 335 } 336 }, 337 "PetType": { 338 "type": "string", 339 "enum": [ 340 "dog", 341 "cat", 342 "fish", 343 "bird", 344 "gecko" 345 ] 346 } 347 } 348}