1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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"
}
Contenus pertinents
- demandé il y a 2 mois
- demandé il y a un an
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a 3 ans
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.