#if($inputRoot.objectType == 'Test'), "TableName": "StudentTests", #else,"TableName": "UserActions", #end
如果使用 if 条件我在 postman 链接中收到错误 ## “__type”:“com.amazon.coral.service#SerializationException” ##
最佳答案
我理解你的问题的方式:
#if($inputRoot.objectType == "Test")
#set($tableName = "StudentTests"
#else
#set($tableName = "UserActions"
#end
{
"TableName": "$tableName",
"Key": ...
}
关于amazon-web-services - 如何在 AWS Api 网关映射模板中使用 IF 条件。我可以在不使用 foreach 的情况下使用 if 条件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55546882/