Skip to main content

is_root_model

Return whether the type info is a root model subclass (or the RootModel class itself).

def is_root_model(
info: TypeInfo
) - > bool

Return whether the type info is a root model subclass (or the RootModel class itself).

Parameters

NameTypeDescription
infoTypeInfoThe type information object used to inspect the class hierarchy for RootModel inheritance

Returns

TypeDescription
boolTrue if the type info represents a Pydantic RootModel or a class inheriting from it, otherwise False