I am getting
"__type": "com.amazon.coral.service#SerializationException"
as a reply in postman & in test console in API Gateway
Trying to post a record directly to dynamodb using API Proxy Services.. I am referring this AWS Article - https://aws.amazon.com/blogs/compute/using-amazon-api-gateway-as-a-proxy-for-dynamodb/
Here's my Mapping
{
"TableName": "TableNameGoesHere",
"Item": {
"id" : "$context.requestId"
"eventName" : "$input.path('$.eventName')",
"timestamp" : $input.path('$.timestamp'),
"answers": "$util.parseJson($input.path('$.answers'))"
}
}
Update: I did as asked ... and it worked but now if I try to add a Array of JSON Objects it gives me the above same error - here's what I am trying to do now. Please help - Couldnt find anything on google as well
#set($inputRoot = $input.path('$'))
{
"TableName": "Answer",
"Item": {
"id": {
"S": "$context.requestId"
},
"eventName": {
"S": "$input.path('$.eventName')"
},
"timestamp" : {
"N": "$input.path('$.timestamp')"
},
"answers": {
"S": "$input.path('$.answers')"
},
"Line": {
"S" : "[
#foreach($elem in $inputRoot.Line)
{
"questionID" : "$elem.questionID",
"answer" : "$elem.answer"
}#if($foreach.hasNext),#end
#end
]" }
}
}