But i want to drop these two plugins if possible since the majority of this is available in the framework already but i feel like i am missing the final piece to turn on the validation
This does work, but i would ideally like to remove the plugins as its an additional dependancy in deploying my application. The header validation being the main thing i care about because it removes the requirement for the code to validate the headers
I donât understand why you need those two plugins. Youâre adding raw CloudFormation, so you should be able to enable validation directly in it. I got it to work, but with an OpenAPI (x-amazon-apigateway-request-validator) script embedded into the Cloudformation, which was deployed via Serverless. That said I donât know why your AWS::ApiGateway::RequestValidator resource wouldnât work.
Anyways, have you figured this out?
Iâm actually trying to somewhat the opposite, I want to disable validation. When you create the gateway in Serverlessâ native way (i.e. below), adding a schema automatically turns on validation and I canât find any way to NOT enable it.
The thing I was looking at was my handler name in serverless
list:
# Defines an HTTP API endpoint that calls the main function in list.js
# - path: url path is /deals
# - method: GET request
handler: list.main
events:
- http:
path: deals
method: get
cors: true
authorizer: aws_iam
request:
parameters:
querystrings:
country: true
type: true
Alternatively, if this does not work, check the s3 bucket, mine was called xxxxxxx-ap-serverlessdeploymentbuck-1epdp60eqveqr and go to serverless > yyyyyyyyyyy > aaaa >
timestamp > compiled-cloudformation-template.json
And look for the name of your method in there, example mine was:
It says âresources.Resources.ApiGatewayMethodPermissionUsersGetâ: should have required property 'Typeâ
So I guess thereâs a lot more that I missed here.
Iâm trying to do as you said, set the request validation configuration in aws.