MCPcopy
hub / github.com/pydantic/pydantic / get_ref

Function get_ref

pydantic/_internal/_core_utils.py:103–107  ·  view source on GitHub ↗

Get the ref from the schema if it has one. This exists just for type checking to work correctly.

(s: core_schema.CoreSchema)

Source from the content-addressed store, hash-verified

101
102
103def get_ref(s: core_schema.CoreSchema) -> None | str:
104 """Get the ref from the schema if it has one.
105 This exists just for type checking to work correctly.
106 """
107 return s.get('ref', None)
108
109
110def _clean_schema_for_pretty_print(obj: Any, strip_metadata: bool = True) -> Any: # pragma: no cover

Callers 3

_model_schemaMethod · 0.85
_dataclass_schemaMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected