Bases: object
request_validator_name (Optional
[str
]) â The name of this request validator. Default: None
validate_request_body (Optional
[bool
]) â Indicates whether to validate the request body according to the configured schema for the targeted API and method. Default: false
validate_request_parameters (Optional
[bool
]) â Indicates whether to validate request parameters. Default: false
infused
Example:
# integration: apigateway.LambdaIntegration # resource: apigateway.Resource # response_model: apigateway.Model # error_response_model: apigateway.Model resource.add_method("GET", integration, # We can mark the parameters as required request_parameters={ "method.request.querystring.who": True }, # we can set request validator options like below request_validator_options=apigateway.RequestValidatorOptions( request_validator_name="test-validator", validate_request_body=True, validate_request_parameters=False ), method_responses=[apigateway.MethodResponse( # Successful response from the integration status_code="200", # Define what parameters are allowed or not response_parameters={ "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 response_models={ "application/json": response_model } ), apigateway.MethodResponse( # Same thing for the error responses status_code="400", response_parameters={ "method.response.header.Content-Type": True, "method.response.header.Access-Control-Allow-Origin": True, "method.response.header.Access-Control-Allow-Credentials": True }, response_models={ "application/json": error_response_model } ) ] )
Attributes
The name of this request validator.
None
Indicates whether to validate the request body according to the configured schema for the targeted API and method.
false
Indicates whether to validate request parameters.
false
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4