Pydantic · Class
RootModel
RootModel defines a Pydantic model around one custom root value, such as a list or dictionary. The root type is set with a generic parameter and the value is available through root.
Last updated
Syntax
class RootModel(BaseModel, Generic[RootModelRootType]): ...
RootModel[RootType]
model_validate(value) -> RootModel[RootType]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
BaseModelmodel_validatemodel_dumpmodel_dump_jsonmodel_json_schemaRootModelRootType