Skip to main content

GetCoreSchemaHandler

Handler to call into the next CoreSchema schema generation function.

Attributes

AttributeTypeDescription
field_name`strNone`

Methods


generate_schema()

@classmethod
def generate_schema(
source_type: Any
) - > core_schema.CoreSchema

Generate a schema unrelated to the current context. Use this function if e.g. you are handling schema generation for a sequence and want to generate a schema for its items.

Parameters

NameTypeDescription
source_typeAnyThe input type to generate a fresh schema for, independent of the current generation context.

Returns

TypeDescription
core_schema.CoreSchemaThe pydantic-core CoreSchema generated.

resolve_ref_schema()

@classmethod
def resolve_ref_schema(
maybe_ref_schema: core_schema.CoreSchema
) - > core_schema.CoreSchema

Get the real schema for a definition-ref schema. If the schema given is not a definition-ref schema, it will be returned as is.

Parameters

NameTypeDescription
maybe_ref_schemacore_schema.CoreSchemaA CoreSchema that may be a ref-based definition or a concrete schema.

Returns

TypeDescription
core_schema.CoreSchemaA concrete CoreSchema resolved from the reference, or the original schema if it was not a reference.

field_name()

@classmethod
def field_name() - > str | None

Get the name of the closest field to this validator.

Returns

TypeDescription
`strNone`