A serverless plugin to associate custom request validator with the API Gateway rest api generated by serverless.
npm install --save-dev serverless-associate-request-validator
Add the plugin to your serverless.yml
file:
plugins:
- serverless-associate-request-validator
Make sure you have defined only 1 resource of type AWS::ApiGateway::RequestValidator
in the resources
section of serverless configuration file.
The plugin would read the resource and associate it with each method of the API Gateway rest api.