Created
January 25, 2018 00:30
-
-
Save berndverst/b59fa0b38544f13c05ae0b77f21d9939 to your computer and use it in GitHub Desktop.
Swagger 2.0 definition for AWS API Gateway endpoint to Proxy API requests and add API client ID and secret
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "2016-09-12T23:19:28Z", | |
"title": "ProxyAPIwithCreds" | |
}, | |
"host": "my-domain.com", | |
"basePath": "/test", | |
"schemes": [ | |
"https" | |
], | |
"paths": { | |
"/search/{proxy+}": { | |
"x-amazon-apigateway-any-method": { | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [ | |
{ | |
"name": "proxy", | |
"in": "path", | |
"required": true, | |
"type": "string" | |
} | |
], | |
"responses": {}, | |
"x-amazon-apigateway-integration": { | |
"responses": { | |
"default": { | |
"statusCode": "200" | |
} | |
}, | |
"requestParameters": { | |
"integration.request.path.proxy": "method.request.path.proxy", | |
"integration.request.querystring.client_id": "'XXXXXXXXX'", | |
"integration.request.querystring.client_secret": "'ZZZZZZZZZ'" | |
}, | |
"uri": "https://external-domain.com/api/{proxy}", | |
"passthroughBehavior": "when_no_match", | |
"httpMethod": "ANY", | |
"type": "http_proxy" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
XXXXXXXXX
with your API client ID and replaceZZZZZZZZZ
with your API client secret. Any other parameters are passed through.x-amazon-apigateway-integration
'suri
field with the desired API endpoint to proxy to.AWS Instructions: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html
Also see the child articles for the different ways to import the Swagger 2.0 template.