Skip to content

Instantly share code, notes, and snippets.

@packetchef
Last active November 30, 2019 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save packetchef/e5fa9750294ec55a501742831e240717 to your computer and use it in GitHub Desktop.
Save packetchef/e5fa9750294ec55a501742831e240717 to your computer and use it in GitHub Desktop.
AWS API Gateway REST API to return a list of IP addresses (Swagger)
{
"swagger": "2.0",
"info": {
"version": "2019-10-28T15:48:36Z",
"title": "ReturnIPList"
},
"host": “aabbccddeeff.execute-api.us-east-2.amazonaws.com",
"basePath": “/prod”,
"schemes": [
"https"
],
"paths": {
"/": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"text/plain"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
},
"headers": {
"Content-Type": {
"type": "string"
}
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Content-Type": "'plain/text'"
},
"responseTemplates": {
"text/plain": “1.2.3.4\n22.33.44.55\n”
}
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"passthroughBehavior": "when_no_match",
"type": "mock"
}
}
}
},
"definitions": {
"Empty": {
"type": "object",
"title": "Empty Schema"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment