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 to check, which could be a Union or any other type. |
Returns
| Type | Description |
|---|---|
bool | True if the field type is a Union and all its members are subclasses of BaseModel, False otherwise. |