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


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 ( But how can I add accept header in serverless.yml?

Thank you

1 Like