MCPcopy
hub / github.com/pydantic/pydantic / schema_of

Function schema_of

pydantic/v1/tools.py:85–87  ·  view source on GitHub ↗

Generate a JSON schema (as dict) for the passed model or dynamically generated one

(type_: Any, *, title: Optional[NameFactory] = None, **schema_kwargs: Any)

Source from the content-addressed store, hash-verified

83
84
85def schema_of(type_: Any, *, title: Optional[NameFactory] = None, **schema_kwargs: Any) -> 'DictStrAny':
86 """Generate a JSON schema (as dict) for the passed model or dynamically generated one"""
87 return _get_parsing_type(type_, type_name=title).schema(**schema_kwargs)
88
89
90def schema_json_of(type_: Any, *, title: Optional[NameFactory] = None, **schema_json_kwargs: Any) -> str:

Callers 2

test_deprecated_moduleFunction · 0.90
test_schemaFunction · 0.90

Calls 2

_get_parsing_typeFunction · 0.85
schemaMethod · 0.45

Tested by 2

test_deprecated_moduleFunction · 0.72
test_schemaFunction · 0.72