1 個回答
- 最新
- 最多得票
- 最多評論
1
Hi,
Take a look at the following implementation example, I hope it will help you.
Code
#set($data='{ "auth":{"tenantId":"foo", "userId":"bar", "groups":"baz"}, "data" :'+$input.json('$')+'}')
#set($data=$util.escapeJavaScript($data))
{
"input" :"$data",
"stateMachineArn": "myArn"
}
Input
{
“Test”: “Test"
}
Output
{
"input" :"{ \"auth\":{\"tenantId\":\"foo\", \"userId\":\"bar\", \"groups\":\"baz\”}, \”data\”: { \”Test\":\”Test\”}}",
"stateMachineArn": "myArn"
}
相關內容
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 10 個月前
Thanks Mikel, that works! Didn't know that I can just concatenate my json string that way. There is no way to convert my VTL object to a json string?
Unfortunately the $util variable does not contain a utility functions for that, and I don't know if there is any other elegant way.