title: AWS child process output bad JSON
body: <p>I'm currently getting this error from my AWS apigateway api using Postman:</p>
  
  <pre><code>{
      "errorType": "Error",
      "errorMessage": "child process output bad JSON: ",
      "stack": [
          "Error: child process output bad JSON: ",
          "    at _homogeneousError (/var/runtime/CallbackContext.js:13:12)",
          "    at postError (/var/runtime/CallbackContext.js:30:51)",
          "    at done (/var/runtime/CallbackContext.js:57:7)",
          "    at fail (/var/runtime/CallbackContext.js:69:7)",
          "    at /var/runtime/CallbackContext.js:105:16",
          "    at process._tickCallback (internal/process/next_tick.js:68:7)"
      ]
  </code></pre>
  
  <p>My json payload is as follows:</p>
  
  <pre><code>{ "resource" : "/updatepic"
  , "body" : "pleasework"}
  
  </code></pre>
  
  <p>My end point is: <code>https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev/updatepic</code></p>
  
  <p>I'm not sure if I'm formatting my JSON payload correctly. I've tried many variations but I'm getting timeouts and the bad JSON error above.</p>
  
  <p>Update:
  This is my event JSON parser:</p>
  
  <pre><code>instance FromJSON Event where
    parseJSON = withObject "Event" $ \v -&gt; do
      bd &lt;- v .: "body"
      rs &lt;- v .: "resource"
      pure $ Event bd rs
  </code></pre>