-
-
Save r7kamura/2a42ea3ad37d703a8597 to your computer and use it in GitHub Desktop.
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
{ | |
"json": $input.json('$.*'), | |
"accountId": "$context.identity.accountId", | |
"allParams": "$input.params()", | |
"apiId": "$context.apiId", | |
"apiKey": "$context.identity.apiKey", | |
"caller": "$context.identity.caller", | |
"headerParams": "$input.params().header", | |
"httpMethod": "$context.httpMethod", | |
"pathParams": "$input.params().path", | |
"queryParams": "$input.params().querystring", | |
"requestId": "$context.requestId", | |
"resourceId": "$context.resourceId", | |
"resourcePath": "$context.resourcePath", | |
"sourceIp": "$context.identity.sourceIp", | |
"stage": "$context.stage", | |
"user": "$context.identity.user", | |
"userAgent": "$context.identity.userAgent", | |
"userArn": "$context.identity.userArn" | |
} |
{...} みたいになってるやつJSONっぽくしたい…
map風のデータ構造には .keySet が実行できるらしい
勝った感じがある
{
"json": $input.json('$.*'),
"accountId": "$context.identity.accountId",
"allParams": "$input.params()",
"apiId": "$context.apiId",
"apiKey": "$context.identity.apiKey",
"caller": "$context.identity.caller",
"headerParams": {
#foreach( $key in $input.params().header.keySet() )
"$key": "$input.params().header.get($key)"#if( $foreach.hasNext ),#end
#end
},
"httpMethod": "$context.httpMethod",
"pathParams": "$input.params().path",
"queryParams": "$input.params().querystring",
"requestId": "$context.requestId",
"resourceId": "$context.resourceId",
"resourcePath": "$context.resourcePath",
"sourceIp": "$context.identity.sourceIp",
"stage": "$context.stage",
"user": "$context.identity.user",
"userAgent": "$context.identity.userAgent",
"userArn": "$context.identity.userArn"
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こうなる