MCPcopy
hub / github.com/pydantic/pydantic / error_extra_fields_on_root_model

Function error_extra_fields_on_root_model

pydantic/mypy.py:1299–1301  ·  view source on GitHub ↗

Emits an error when there is more than just a root field defined for a subclass of RootModel.

(api: CheckerPluginInterface, context: Context)

Source from the content-addressed store, hash-verified

1297
1298
1299def error_extra_fields_on_root_model(api: CheckerPluginInterface, context: Context) -> None:
1300 """Emits an error when there is more than just a root field defined for a subclass of RootModel."""
1301 api.fail('Only `root` is allowed as a field of a `RootModel`', context, code=ERROR_EXTRA_FIELD_ROOT_MODEL)
1302
1303
1304def add_method(

Callers 1

Calls 1

failMethod · 0.80

Tested by

no test coverage detected