Accept only Content-Type: 'application/json' for a HTTP event

Hi,

Even though I include a validation schema other types are accepted by the API Gateway after deploying to AWS. For example plain texts are accepted. Of course error handling can be done for that. But is there any way to accept only a JSON data to the API. If so, how can I include it in the serverless.yml. I checked the documentation and found Lambda Integration (https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#lambda-integration). But how can I add accept header in serverless.yml?

Thank you

1 Like