Created
May 16, 2017 06:34
-
-
Save nilesuan/f2a0a0b1f364ba84769790ac1f40d253 to your computer and use it in GitHub Desktop.
AWS API Gateway Body Mapping Template
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
#set($allParams = $input.params()) | |
{ | |
"body-json" : $input.json('$'), | |
"params" : { | |
#foreach($type in $allParams.keySet()) | |
#set($params = $allParams.get($type)) | |
"$type" : { | |
#foreach($paramName in $params.keySet()) | |
"$paramName" : "$util.escapeJavaScript($params.get($paramName))" | |
#if($foreach.hasNext),#end | |
#end | |
} | |
#if($foreach.hasNext),#end | |
#end | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment