Class LambdaSchemaValidator


  • public class LambdaSchemaValidator
    extends Object
    It is called in the Lambda framework to validate the request against the openapi.yaml specification. Each function will have the openapi.yaml packaged as configuration and this class will use it to validate the request headers, query parameters, path parameters and body based on the json schema. The validateRequest is called by the request-handler that intercepts the request and response in the App.
    Author:
    Steve Hu, Gavin Chen
    • Constructor Detail

      • LambdaSchemaValidator

        public LambdaSchemaValidator()
    • Method Detail

      • validateRequest

        public com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent validateRequest​(com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent requestEvent)
        Validate the request based on the openapi.yaml specification
        Parameters:
        requestEvent - request event
        Returns:
        responseEvent if error and null if pass.