is_union_of_base_models
Check if field type is a Union where all members are BaseModel subclasses.
def is_union_of_base_models(
field_type: Any
) - > bool
Check if field type is a Union where all members are BaseModel subclasses.
Parameters
| Name | Type | Description |
|---|---|---|
| field_type | Any | The type hint or class to evaluate for Union membership and BaseModel compatibility |
Returns
| Type | Description |
|---|---|
bool | True if the type is a Union and every member of that Union is a subclass of Pydantic's BaseModel, otherwise False |