definition_reference_schema
Returns a schema that points to a schema stored in "definitions", this is useful for nested recursive models and also when you want to define validators separately from the main schema, e.g.:
```py
from pydantic_core import SchemaValidator, core_schema
schema_definition = core_schema.definition_reference_schema('list-schema')
schema = core_schema.definitions_schema(
schema=schema_definition,
definitions=[
core_schema.list_schema(items_schema=schema_definition, ref='list-schema'),
],
)
v = SchemaValidator(schema)
assert v.validate_python([()]) == [[]]
```
def definition_reference_schema(
schema_ref: string,
ref: string | None = null,
metadata: dict[str, Any] | None = null,
serialization: SerSchema | None = null
) - > DefinitionReferenceSchema
Returns a schema that points to a schema stored in "definitions", this is useful for nested recursive models and also when you want to define validators separately from the main schema.
Parameters
| Name | Type | Description |
|---|---|---|
| schema_ref | string | The identifier of the schema definition to reference within the definitions collection. |
| ref | `string | None` = null |
| metadata | `dict[str, Any] | None` = null |
| serialization | `SerSchema | None` = null |
Returns
| Type | Description |
|---|---|
DefinitionReferenceSchema | A schema dictionary of type 'definition-ref' that references a definition by its unique identifier. |