Usage of the plugin

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 ...

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.