Reputation: 1403
I want to change the body mapping template of get method integration request. But the Invalid cache key parameter specified showed. What happened ? I try to close the query mapping, reopen browser, relogin or remove the template to build a new one, However the Invalid cache key parameter specified error dialog still showed up.
Here is my template
#set($allParams = $input.params())
{
#foreach($type in $allParams.keySet())
#set($params = $allParams.get($type))
#foreach($paramName in $params.keySet())
"$paramName" : "$util.escapeJavaScript($params.get($paramName))"
#end
#end
}
If there are something details you want to ask for to help me, please let me know.
Upvotes: 2
Views: 822
Reputation: 1403
Since that the aws api gateway testing and stage deploy are in different way. Here is the template that solved this problem.
#set($inputRoot = $input.path('$'))
#if ($input.params().querystring.keySet().contains("id"))
{
"id": $input.params().querystring.get('id')
}
#end
Upvotes: 1