Skip to main content

RequestValidationError

This class represents an exception raised when a request fails validation against a defined schema. It captures a sequence of validation errors and optionally stores the request body and endpoint context associated with the failure.

Attributes

AttributeTypeDescription
bodyAny = NoneThe original request body that triggered the validation error, used for debugging or reporting the source of the failure.

Constructor

Signature

def RequestValidationError(
errors: Sequence[Any],
body: Any = None,
endpoint_ctx: EndpointContext | None = None
) - > None

Parameters

NameTypeDescription
errorsSequence[Any]A sequence of validation error details.
bodyAny = NoneThe request body that failed validation.
endpoint_ctx`EndpointContextNone` = None

Signature

def RequestValidationError(
errors: Sequence[Any],
body: Any = None,
endpoint_ctx: EndpointContext | None = None
) - > null

Parameters

NameTypeDescription
errorsSequence[Any]A sequence of error details or Pydantic error dictionaries describing the specific validation failures.
bodyAny = NoneThe raw or partially parsed request body that triggered the validation errors, preserved for debugging or error reporting.
endpoint_ctx`EndpointContextNone` = None