Skip to content

Instantly share code, notes, and snippets.

@ToQoz
Last active December 8, 2015 16:59
Show Gist options
  • Save ToQoz/066500e4ec8dfa931958 to your computer and use it in GitHub Desktop.
Save ToQoz/066500e4ec8dfa931958 to your computer and use it in GitHub Desktop.
application/x-www-form-urlencoded
#set($form = $input.path('$').split('&'))
{
#foreach($kvString in $form)
#set($kv = $kvString.split('='))
"$kv[0]": "$util.urlDecode($kv[1])"#if($foreach.hasNext),#end
#end
}
@ToQoz
Copy link
Author

ToQoz commented Dec 8, 2015

awsm.json 等、JSON内で文字列として書かないといけない場合

curl https://gist.githubusercontent.com/ToQoz/066500e4ec8dfa931958/raw/mapping-template |
  sed -e 's/"/\\"/g' | perl -pe 's/\n/\\n/g'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment