There are lots of questions about the mapping templates but I couldn’t find resolution to my problem.
I have a api endpoint path PUT /foo/bar/{clientNumber} and the body is
{
"progress": {
"client": {
"name": "client",
"site": {
"name": "site"
}
}
}
}
I have tried to many different solutions to this but somehow I don’t seem to get it right. I need my endpoint lambda to get the clientNumber from the path and the progress object from the body.
At the moment I have template like this:
"clientNumber": $input.params('clientNumber'),
"progress" : $util.parseJson($input.body)
And the result is:
Endpoint request body after transformations:
{
"clientNumber": "",
"progress": "{progress={client={name=client, site={name=site}}}}"
}
I’m using CDK to build this, if that’s something to consider.