Skip to content
v2.273.0

RequestValidatorProps Struct ​

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';

declare const restApi: apigateway.RestApi;
const requestValidatorProps: apigateway.RequestValidatorProps = {
  restApi: restApi,

  // the properties below are optional
  requestValidatorName: 'requestValidatorName',
  validateRequestBody: false,
  validateRequestParameters: false,
};

Properties ​

requestValidatorNamestringrequest_validator_namestrrequestValidatorNameStringRequestValidatorNamestringRequestValidatorName*string= None#
The name of this request validator.
restApiIRestApirest_apiIRestApirestApiIRestApiRestApiIRestApiRestApiIRestApirequired#
The rest API that this model is part of.
notes

The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating its hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.

validateRequestBodybooleanvalidate_request_bodyboolvalidateRequestBodyBooleanValidateRequestBodyboolValidateRequestBody*bool= false#
Indicates whether to validate the request body according to the configured schema for the targeted API and method.
validateRequestParametersbooleanvalidate_request_parametersboolvalidateRequestParametersBooleanValidateRequestParametersboolValidateRequestParameters*bool= false#
Indicates whether to validate request parameters.

Used as props by ​