@@ -38,31 +38,52 @@ paths:
38
38
passthroughBehavior : " when_no_templates"
39
39
httpMethod : " POST"
40
40
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
+
66
87
contentHandling : " CONVERT_TO_TEXT"
67
88
type : " aws"
68
89
definitions :
0 commit comments