AWS Lambda Error : 'Could not parse request body into json ' when url parameter contains JSON array
<p>I am trying to invoke my <strong>Lambda</strong> function by passing parameters as below. it contains <strong>apostrophe(')</strong>.</p>

<pre><code>https://invoke_url?param=[["kurlo jack's book","Adventure Books",8.8,1]]
</code></pre>

<p>Stringifyed to be '<a href="https://invoke_url?param=%5B%5B%229780786706211%22s" rel="noreferrer">https://invoke_url?param=%5B%5B%229780786706211%22s</a>....`</p>

<p>I used the mapping below to pass parameter to lambda  </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>  "query": {
    #foreach($queryParam in $input.params().querystring.keySet())
    "$queryParam": "$util.escapeJavaScript($input.params().querystring.get($queryParam))" #if($foreach.hasNext),#end

    #end
  }  </code></pre>
</div>
</div>
</p>

<p>I got following error  </p>

<pre><code>{"message": "Could not parse request body into json: Unrecognized character escape \'\'\' (code 39)\n at [Source: [B@5b70c341; line: 29, column: 65]"}  
</code></pre>

<p>i have also tried after removing double quotes from mapping template. But did't work.</p>