Pydantic · Method
RootModel.root
RootModel defines a Pydantic model around one root value, such as a list or dictionary. The value is passed directly, accessed with root, and serialized without an extra root field.
Last updated
Syntax
class Pets(RootModel[list[str]]):
...In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
BaseModelmodel_validatemodel_constructmodel_dumpmodel_dump_jsonRootModelRootType