Skip to content

Instantly share code, notes, and snippets.

@kvnn
Created August 17, 2016 20:22
Show Gist options
  • Save kvnn/cd1d4be487ffaa3b065dbff3a6b18f25 to your computer and use it in GitHub Desktop.
Save kvnn/cd1d4be487ffaa3b065dbff3a6b18f25 to your computer and use it in GitHub Desktop.
#set($allParams = $input.params())
{
"params" : {
#foreach($type in $allParams.keySet())
#set($params = $allParams.get($type))
"$type" : {
#foreach($paramName in $params.keySet())
"$paramName" : "$util.escapeJavaScript($params.get($paramName)).replaceAll("\\'", "'")"
#if($foreach.hasNext),#end
#end
}
#if($foreach.hasNext),#end
#end
},
"stageVariables" : {
#foreach($key in $stageVariables.keySet())
"$key" : "$util.escapeJavaScript($stageVariables.get($key))"
#if($foreach.hasNext),#end
#end
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment