问题
#if($inputRoot.objectType == 'Test'), "TableName": "StudentTests", #else,"TableName": "UserActions", #end
if use if condition i got an error in postman link ## "__type": "com.amazon.coral.service#SerializationException" ##
回答1:
The way I understand your question I would do :
#if($inputRoot.objectType == "Test")
#set($tableName = "StudentTests"
#else
#set($tableName = "UserActions"
#end
{
"TableName": "$tableName",
"Key": ...
}
来源:https://stackoverflow.com/questions/55546882/how-to-use-if-condition-in-aws-api-gateway-mapping-templates-can-i-use-if-condi