I cannot figure out how to create optional query string parameters using the mapping pattern in my resource integration request.
My template looks like this:
{ "limit": "$input.params('limit')", "post_date":"$input.params('post_date')" }
I would like "limit" and "post_date" to be optional. This template creates a query that looks like when these parameters are not provided:
/myresource?limit=undefined&
When I expect:
/myresource
Docs don't seem to cover this. I found some sample templates in the documentation that use bash syntax to provide conditional functionality. I tried to test the following, but it will not be tested in the AWS console:
#set($limit = $input.path('limit')) {
Am I on the right track?
Thanks!
amazon-web-services aws-lambda aws-api-gateway
Nick
source share