MCPcopy
hub / github.com/pydantic/pydantic / ModelWithStrictConfig

Class ModelWithStrictConfig

tests/test_strict.py:39–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37@pytest.fixture(scope='session', name='ModelWithStrictConfig')
38def model_with_strict_config_false():
39 class ModelWithStrictConfig(BaseModel):
40 a: int
41 # strict=False overrides the Config
42 b: Annotated[int, Field(strict=False)]
43 # strict=None or not including it is equivalent
44 # lets this field be overridden by the Config
45 c: Annotated[int, Field(strict=None)]
46 d: Annotated[int, Field()]
47
48 model_config = ConfigDict(strict=True)
49
50 return ModelWithStrictConfig
51

Calls 2

FieldFunction · 0.90
ConfigDictClass · 0.90