aws-cdk-lib.aws_apigateway.RequestValidatorProps

interface RequestValidatorProps

LanguageType name
.NETAmazon.CDK.AWS.APIGateway.RequestValidatorProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#RequestValidatorProps
Javasoftware.amazon.awscdk.services.apigateway.RequestValidatorProps
Pythonaws_cdk.aws_apigateway.RequestValidatorProps
TypeScript (source)aws-cdk-lib » aws_apigateway » RequestValidatorProps

Example

// 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

NameTypeDescription
restApiIRestApiThe rest API that this model is part of.
requestValidatorName?stringThe name of this request validator.
validateRequestBody?booleanIndicates whether to validate the request body according to the configured schema for the targeted API and method.
validateRequestParameters?booleanIndicates whether to validate request parameters.

restApi

Type: IRestApi

The rest API that this model is part of.

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 it's hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.


requestValidatorName?

Type: string (optional, default: None)

The name of this request validator.


validateRequestBody?

Type: boolean (optional, default: false)

Indicates whether to validate the request body according to the configured schema for the targeted API and method.


validateRequestParameters?

Type: boolean (optional, default: false)

Indicates whether to validate request parameters.