Skip to content

Api Gateway  >  Operations  >  create_request_validator

create_request_validator

Operation

create_request_validator async

create_request_validator(input: CreateRequestValidatorInput, plugins: list[Plugin] | None = None) -> CreateRequestValidatorOutput

Creates a RequestValidator of a given RestApi.

Parameters:

Name Type Description Default
input CreateRequestValidatorInput

An instance of CreateRequestValidatorInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateRequestValidatorOutput

An instance of CreateRequestValidatorOutput.

Input

CreateRequestValidatorInput dataclass

Creates a RequestValidator of a given RestApi.

Attributes

name class-attribute instance-attribute
name: str | None = None

The name of the to-be-created RequestValidator.

rest_api_id class-attribute instance-attribute
rest_api_id: str | None = None

The string identifier of the associated RestApi.

validate_request_body class-attribute instance-attribute
validate_request_body: bool = False

A Boolean flag to indicate whether to validate request body according to the configured model schema for the method (true) or not (false).

validate_request_parameters class-attribute instance-attribute
validate_request_parameters: bool = False

A Boolean flag to indicate whether to validate request parameters, true, or not false.

Output

CreateRequestValidatorOutput dataclass

A set of validation rules for incoming Method requests.

Attributes

id class-attribute instance-attribute
id: str | None = None

The identifier of this RequestValidator.

name class-attribute instance-attribute
name: str | None = None

The name of this RequestValidator

validate_request_body class-attribute instance-attribute
validate_request_body: bool = False

A Boolean flag to indicate whether to validate a request body according to the configured Model schema.

validate_request_parameters class-attribute instance-attribute
validate_request_parameters: bool = False

A Boolean flag to indicate whether to validate request parameters (true) or not (false).