You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: I have a directory with a large amount of pydantic models and enums are mixed together in several directories. It is difficult to discern which is a model and which is an enum from naming alone. I propose we add support for documenting enums (which are typically used extensively in pydantic models) with autopydantic_model so developers do not have to sift through and separate enums to use autoclass
Related: it would be useful to print the model in question that is failing here:
File "/opt/conda/envs/arcgis/lib/python3.11/site-packages/sphinxcontrib/autodoc_pydantic/inspection.py", line 473, in get_field_validator_mapping
decorators = self.model.__pydantic_decorators__
I have the same understanding and would like to elaborate, as I have the same issue.
classUserType(str, Enum):
USER="user"SERVICE="service"classUser(BaseModel):
email: str=Field(..., description="The email address of the user.")
first_name: str=Field(..., description="The first name of the user.")
last_name: str=Field(..., description="The last name of the user.")
user_type: UserType=Field(UserType.USER, description="Whether this is a regular user or a service account.")
UserType is displayed as class, instead of a pydantic model.
Use case: I have a directory with a large amount of pydantic models and enums are mixed together in several directories. It is difficult to discern which is a model and which is an enum from naming alone. I propose we add support for documenting enums (which are typically used extensively in pydantic models) with autopydantic_model so developers do not have to sift through and separate enums to use
autoclass
to
Where Order is defined as (e.g.):
Current behavior when using
autopydantic_model
on a class that inherits fromEnum
:Thank you. This library is immensely useful to us.
The text was updated successfully, but these errors were encountered: