Skip to main content

BeforeValidatorFunctionSchema

This class represents a schema for validation logic that executes before standard parsing and validation. It defines a function-based validator that receives raw input data and can transform it before it is processed by the inner core schema.

Attributes

AttributeTypeDescription
typeLiteral['function-before']A fixed literal string used to identify the schema as a 'function-before' validator type.
json_schema_input_schemaCoreSchemaThe underlying CoreSchema used to define the expected input structure for the JSON schema generation.

Constructor

Signature

def BeforeValidatorFunctionSchema()

Methods


type()

def type() - > Required[Literal['function-before']]

Specifies the schema type identifier for a 'before' validator function.

Returns

TypeDescription
Required[Literal['function-before']]A literal string indicating this schema applies a validation function before standard processing.

json_schema_input_schema()

def json_schema_input_schema() - > CoreSchema

Defines the underlying core schema used to validate the input data before it is passed to the validator function.

Returns

TypeDescription
CoreSchemaThe schema definition used for the initial validation step.