Skip to content
This repository was archived by the owner on Jul 14, 2023. It is now read-only.

Commit d67c6b1

Browse files
committed
re-format mapping to make it readable
1 parent 678f973 commit d67c6b1

File tree

1 file changed

+46
-25
lines changed

1 file changed

+46
-25
lines changed

swagger.yaml

+46-25
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,52 @@ paths:
3838
passthroughBehavior: "when_no_templates"
3939
httpMethod: "POST"
4040
requestTemplates:
41-
application/x-www-form-urlencoded: "## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html\n\
42-
## This template will pass through all parameters including path, querystring,\
43-
\ header, stage variables, and context through to the integration endpoint\
44-
\ via the body/payload\n#set($allParams = $input.params())\n{\n\"payload\"\
45-
\ : $input.json('$'),\n\"params\" : {\n#foreach($type in $allParams.keySet())\n\
46-
\ #set($params = $allParams.get($type))\n\"$type\" : {\n #foreach($paramName\
47-
\ in $params.keySet())\n \"$paramName\" : \"$util.escapeJavaScript($params.get($paramName))\"\
48-
\n #if($foreach.hasNext),#end\n #end\n}\n #if($foreach.hasNext),#end\n\
49-
#end\n},\n\"stage-variables\" : {\n#foreach($key in $stageVariables.keySet())\n\
50-
\"$key\" : \"$util.escapeJavaScript($stageVariables.get($key))\"\n \
51-
\ #if($foreach.hasNext),#end\n#end\n},\n\"context\" : {\n \"account-id\"\
52-
\ : \"$context.identity.accountId\",\n \"api-id\" : \"$context.apiId\"\
53-
,\n \"api-key\" : \"$context.identity.apiKey\",\n \"authorizer-principal-id\"\
54-
\ : \"$context.authorizer.principalId\",\n \"caller\" : \"$context.identity.caller\"\
55-
,\n \"cognito-authentication-provider\" : \"$context.identity.cognitoAuthenticationProvider\"\
56-
,\n \"cognito-authentication-type\" : \"$context.identity.cognitoAuthenticationType\"\
57-
,\n \"cognito-identity-id\" : \"$context.identity.cognitoIdentityId\"\
58-
,\n \"cognito-identity-pool-id\" : \"$context.identity.cognitoIdentityPoolId\"\
59-
,\n \"http-method\" : \"$context.httpMethod\",\n \"stage\" : \"\
60-
$context.stage\",\n \"source-ip\" : \"$context.identity.sourceIp\"\
61-
,\n \"user\" : \"$context.identity.user\",\n \"user-agent\" : \"\
62-
$context.identity.userAgent\",\n \"user-arn\" : \"$context.identity.userArn\"\
63-
,\n \"request-id\" : \"$context.requestId\",\n \"resource-id\" :\
64-
\ \"$context.resourceId\",\n \"resource-path\" : \"$context.resourcePath\"\
65-
\n }\n}\n"
41+
application/x-www-form-urlencoded: |
42+
## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
43+
## This template will pass through all parameters including path, querystring, header, stage variables, and context through to the integration endpoint via the body/payload
44+
#set($allParams = $input.params())
45+
{
46+
"payload" : $input.json('$'),
47+
"params" : {
48+
#foreach($type in $allParams.keySet())
49+
#set($params = $allParams.get($type))
50+
"$type" : {
51+
#foreach($paramName in $params.keySet())
52+
"$paramName" : "$util.escapeJavaScript($params.get($paramName))"
53+
#if($foreach.hasNext),#end
54+
#end
55+
}
56+
#if($foreach.hasNext),#end
57+
#end
58+
},
59+
"stage-variables" : {
60+
#foreach($key in $stageVariables.keySet())
61+
"$key" : "$util.escapeJavaScript($stageVariables.get($key))"
62+
#if($foreach.hasNext),#end
63+
#end
64+
},
65+
"context" : {
66+
"account-id" : "$context.identity.accountId",
67+
"api-id" : "$context.apiId",
68+
"api-key" : "$context.identity.apiKey",
69+
"authorizer-principal-id" : "$context.authorizer.principalId",
70+
"caller" : "$context.identity.caller",
71+
"cognito-authentication-provider" : "$context.identity.cognitoAuthenticationProvider",
72+
"cognito-authentication-type" : "$context.identity.cognitoAuthenticationType",
73+
"cognito-identity-id" : "$context.identity.cognitoIdentityId",
74+
"cognito-identity-pool-id" : "$context.identity.cognitoIdentityPoolId",
75+
"http-method" : "$context.httpMethod",
76+
"stage" : "$context.stage",
77+
"source-ip" : "$context.identity.sourceIp",
78+
"user" : "$context.identity.user",
79+
"user-agent" : "$context.identity.userAgent",
80+
"user-arn" : "$context.identity.userArn",
81+
"request-id" : "$context.requestId",
82+
"resource-id" : "$context.resourceId",
83+
"resource-path" : "$context.resourcePath"
84+
}
85+
}
86+
6687
contentHandling: "CONVERT_TO_TEXT"
6788
type: "aws"
6889
definitions:

0 commit comments

Comments
 (0)