@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-14T16:25:33.452Z")
public interface RequestValidatorOptions
LambdaIntegration integration; Resource resource; Model responseModel; Model errorResponseModel; resource.addMethod("GET", integration, MethodOptions.builder() // We can mark the parameters as required .requestParameters(Map.of( "method.request.querystring.who", true)) // we can set request validator options like below .requestValidatorOptions(RequestValidatorOptions.builder() .requestValidatorName("test-validator") .validateRequestBody(true) .validateRequestParameters(false) .build()) .methodResponses(List.of(MethodResponse.builder() // Successful response from the integration .statusCode("200") // Define what parameters are allowed or not .responseParameters(Map.of( "method.response.header.Content-Type", true, "method.response.header.Access-Control-Allow-Origin", true, "method.response.header.Access-Control-Allow-Credentials", true)) // Validate the schema on the response .responseModels(Map.of( "application/json", responseModel)) .build(), MethodResponse.builder() // Same thing for the error responses .statusCode("400") .responseParameters(Map.of( "method.response.header.Content-Type", true, "method.response.header.Access-Control-Allow-Origin", true, "method.response.header.Access-Control-Allow-Credentials", true)) .responseModels(Map.of( "application/json", errorResponseModel)) .build())) .build());
Modifier and Type | Interface and Description |
---|---|
static class |
RequestValidatorOptions.Builder
A builder for
RequestValidatorOptions |
static class |
RequestValidatorOptions.Jsii$Proxy
An implementation for
RequestValidatorOptions |
Modifier and Type | Method and Description |
---|---|
static RequestValidatorOptions.Builder |
builder() |
default java.lang.String |
getRequestValidatorName()
The name of this request validator.
|
default java.lang.Boolean |
getValidateRequestBody()
Indicates whether to validate the request body according to the configured schema for the targeted API and method.
|
default java.lang.Boolean |
getValidateRequestParameters()
Indicates whether to validate request parameters.
|
default java.lang.String getRequestValidatorName()
Default: None
default java.lang.Boolean getValidateRequestBody()
Default: false
default java.lang.Boolean getValidateRequestParameters()
Default: false
static RequestValidatorOptions.Builder builder()
RequestValidatorOptions.Builder
of RequestValidatorOptions