The following are the contents of the resource/api/apiValidator.yml file:
Resources: requestBodyValidator: Type: AWS::ApiGateway::RequestValidator Properties: Name: 'lets-poll-api-request-body-validator' RestApiId: Ref: ApiGatewayRestApi ValidateRequestBody: true ValidateRequestParameters: false requestParmaterValidator: Type: AWS::ApiGateway::RequestValidator Properties: Name: 'lets-poll-api-request-parameters-validator' RestApiId: Ref: ApiGatewayRestApi ValidateRequestBody: false ValidateRequestParameters: true
A few things to note in the preceding code:
- We define a AWS::APIGateway::RequestValidator resource named requestBodyValidator by using CloudFormation syntax. This will be used to validate the request body ...