AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

RequestValidator

Import

import { RequestValidator } from 'aws-cdk-lib/aws-apigateway';

Or use the module namespace:

import * as apigateway from 'aws-cdk-lib/aws-apigateway';
// apigateway.RequestValidator

Properties

Configuration passed to the constructor as RequestValidatorProps.

restApiRequired
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 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.

3 properties inherited from RequestValidatorOptions
requestValidatorNameOptionalinherited from RequestValidatorOptions
string

The name of this request validator.

Default: None

validateRequestBodyOptionalinherited from RequestValidatorOptions
boolean

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

Default: false

validateRequestParametersOptionalinherited from RequestValidatorOptions
boolean

Indicates whether to validate request parameters.

Default: false

Get the Amazon API Gateway Cheat Sheet

Everything you need to know about Amazon API Gateway on one page. HD quality, print-friendly.

Download Free Infographic