Last active
March 7, 2017 19:44
-
-
Save rotemtam/ffe46ede1e90e8501a3c3daea2ad137d to your computer and use it in GitHub Desktop.
api gateway swagger example
This file contains hidden or 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": "2017-02-26T12:58:40Z", | |
"title": "SampleProject" | |
}, | |
"host": "<host_id>.execute-api.us-east-1.amazonaws.com", | |
"basePath": "/dev", | |
"schemes": [ | |
"https" | |
], | |
"paths": { | |
"/repos/{id}": { | |
"post": { | |
// .. skipping some attributes for brevity | |
"x-amazon-apigateway-integration": { | |
// .. skipping more attributes for brevity | |
"credentials": "arn:aws:iam::<account number>:role/APIGatewayLambdaInvokeRole", | |
"requestTemplates": { | |
"application/json": "{\n \"method\": \"$context.httpMethod\",\n \"body\" : $input.json('$'),\n \"headers\": {\n #foreach($param in $input.params().header.keySet())\n \"$param\": \"$util.escapeJavaScript($input.params().header.get($param))\" #if($foreach.hasNext),#end\n \n #end\n },\n \"queryParams\": {\n #foreach($param in $input.params().querystring.keySet())\n \"$param\": \"$util.escapeJavaScript($input.params().querystring.get($param))\" #if($foreach.hasNext),#end\n \n #end\n },\n \"pathParams\": {\n #foreach($param in $input.params().path.keySet())\n \"$param\": \"$util.escapeJavaScript($input.params().path.get($param))\" #if($foreach.hasNext),#end\n \n #end\n },\n \"context\" : {\n \"gateway-request-id\" : \"$context.requestId\"\n }\n}" | |
}, | |
"uri": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:<account>:function:SampleProject_getRepositories/invocations", | |
"httpMethod": "POST", | |
"type": "aws" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment