gpt4 book ai didi

amazon-web-services - 如何在 AWS Api 网关映射模板中使用 IF 条件。我可以在不使用 foreach 的情况下使用 if 条件吗?

转载 作者:行者123 更新时间:2023-12-05 02:12:43 25 4
gpt4 key购买 nike

#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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com