MCPcopy
hub / github.com/pydantic/pydantic / test_custom_schema

Function test_custom_schema

tests/test_generics.py:683–690  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

681
682
683def test_custom_schema():
684 T = TypeVar('T')
685
686 class MyModel(BaseModel, Generic[T]):
687 a: int = Field(1, description='Custom')
688
689 schema = MyModel[int].model_json_schema()
690 assert schema['properties']['a'].get('description') == 'Custom'
691
692
693def test_child_schema():

Callers

nothing calls this directly

Calls 2

model_json_schemaMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected