我有一个PUT API网关端点,应该用它来更新DynamoDB条目。
该DynamoDB条目的id作为路径参数给出。
我有以下映射模板:
"application/json": {
"id": "$input.params('id')",
"title": "$input.json('$.title')"
}
按预期返回id。
如果我提交此请求正文
{
"title": "Hello world"
}
我收到错误Could not parse request body into json: Unexpected character (\'t\'
以下是我的AWS管理控制台的概述:
我错过了什么?
答案 0 :(得分:1)
所以我找到了解决方案:
"title": "$input.json('$.title')"
应该是
"title": $input.json('$.title')
(没有双引号)。