Skip to main content

BeforeValidator

A metadata class that indicates that a validation should be applied before the inner validation logic.

Attributes

AttributeTypeDescription
func`core_schema.NoInfoValidatorFunctioncore_schema.WithInfoValidatorFunction`
json_schema_input_typeAny = PydanticUndefinedThe input type used to generate the appropriate JSON Schema (in validation mode).

Constructor

Signature

def BeforeValidator(
func: core_schema.NoInfoValidatorFunction | core_schema.WithInfoValidatorFunction,
json_schema_input_type: Any = PydanticUndefined
) - > null

Parameters

NameTypeDescription
func`core_schema.NoInfoValidatorFunctioncore_schema.WithInfoValidatorFunction`
json_schema_input_typeAny = PydanticUndefinedThe input type used to generate the appropriate JSON Schema.