Check if the schema is a BaseModel type (not a generic alias). Args: schema: The schema to check. Returns: True if schema is a BaseModel class, False otherwise.
(schema: SchemaType)
| 44 | |
| 45 | |
| 46 | def is_basemodel_schema(schema: SchemaType) -> bool: |
| 47 | """Check if the schema is a BaseModel type (not a generic alias). |
| 48 | |
| 49 | Args: |
| 50 | schema: The schema to check. |
| 51 | |
| 52 | Returns: |
| 53 | True if schema is a BaseModel class, False otherwise. |
| 54 | """ |
| 55 | return isinstance(schema, type) and issubclass(schema, BaseModel) |
| 56 | |
| 57 | |
| 58 | def is_list_of_basemodel(schema: SchemaType) -> bool: |
no outgoing calls