Package com.networknt.aws.lambda
Class LambdaSchemaValidator
java.lang.Object
com.networknt.aws.lambda.LambdaSchemaValidator
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetBasePath(String requestPath) com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEventvalidateRequest(com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent requestEvent) Validate the request based on the openapi.yaml specification
-
Field Details
-
config
public static com.networknt.openapi.ValidatorConfig config -
helper
public static com.networknt.openapi.OpenApiHelper helper
-
-
Constructor Details
-
LambdaSchemaValidator
public LambdaSchemaValidator()
-
-
Method Details
-
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.
-
getBasePath
-