I am trying to create a apigateway mapping template, that transforms this:
{
"ref": "refs/heads/master"
}
into this:
{
"download_url":"http://example.com/master"
}
So I tried this:
{
"branch": $input.path($.ref).substring($input.path($.ref).lastIndexOf('/')+1)
}
Testing this method I get a simple error:
Execution failed due to configuration error: Unable to transform request
Now, of course I would like to know why this failed. But more importantly: How can I debug this? Is there anyway to get a more describing error message for a mapping template?
Not with API Gateway directly, but since API Gateway uses the Velocity template engine under the hood you might consider downloading and running the velocity engine on your own computer to debug your templates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With