Pydantic · Decorator
validate_call
Use @validate_call to check function arguments against their type annotations before the function runs. It can also validate the return value and raises ValidationError for invalid calls.
Last updated
Syntax
validate_call(func: AnyCallableT, /) -> AnyCallableT
validate_call(*, config: ConfigDict | None = None, validate_return: bool = False) -> Callable[[AnyCallableT], AnyCallableT]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
ValidationErrorConfigDictFieldAnnotatedraw_functionStrict modeTypedDictUnpack