I am using API Gateway to build a patch method.
In then Integration Request - Mapping Template i added:
{ "id": "$input.params('subscription-id')",
"env": "$stageVariables['env']",
"street": $input.json('street'),
"address_name": $input.json('address_name'),
"payment_day": $input.json('payment_day'),
}
As a patch http method, the user's API is not required to pass all the parameters.
So if the user doesn't pass, for e.g. payment_day, the field is going to be ''. The '' can be a valid value field. So i have two options:
- Put a NULL value on the payment_day field.
- Remove the payment_day from JSON request.
Is it possible to do this on API Gateway Integration Request -Mapping Template? Does anyone has a workaround?
$input.json('$')and sort it out in the Lambda function.