I'm validating the payload of a request via a model - see serverless.yml extract below:
functions:
authorizer:
handler: src/authorization/authorizer.general
activity:
handler: src/resources/activity.submit
events:
- http:
path: /tenant/{tenant}/activities
method: POST
cors: true
authorizer: ${self:custom.authorizer.general}
request:
schema:
application/json: ${file(models/activity.json)
All works as expected, but the validation response for a payload that does not match the schema is:
{
"message": "Invalid request body"
}
I've tried adding a response template but get a warning that 'response' will be removed (this is a lambda proxy integration, not a lambda integration).
How do I get API Gateway to give a detailed validation error message response in this scenario (i.e. a Lambda Proxy integration)?
Any help would be much appreciated as I can't find anything relevant online.