GetCoreSchemaHandler
Handler to call into the next CoreSchema schema generation function.
Attributes
| Attribute | Type | Description |
|---|---|---|
| field_name | `str | None` |
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
| Name | Type | Description |
|---|---|---|
| source_type | Any | The input type to generate a fresh schema for, independent of the current generation context. |
Returns
| Type | Description |
|---|---|
core_schema.CoreSchema | The 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
| Name | Type | Description |
|---|---|---|
| maybe_ref_schema | core_schema.CoreSchema | A CoreSchema that may be a ref-based definition or a concrete schema. |
Returns
| Type | Description |
|---|---|
core_schema.CoreSchema | A 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
| Type | Description |
|---|---|
| `str | None` |