Package com.networknt.aws.lambda
Class LambdaSchemaValidator
- java.lang.Object
-
- com.networknt.aws.lambda.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 Summary
Constructors Constructor Description LambdaSchemaValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEventvalidateRequest(com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent requestEvent)Validate the request based on the openapi.yaml specification
-
-
-
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.
-
-