-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X
Description
@samuelcolvin current implementation causes issues with Path subclasses (same goes for other classes in field_class_to_schema_enum_disabled I presume):
class ConstrainedPath(Path):
extensions = None
@classmethod
def __modify_schema__(cls, schema: dict):
update_not_none(schema, extensions=cls.extensions)
class ImagePath(ConstrainedPath):
extensions = ['.jpg']
class Model(BaseModel):
path: ConstrainedPath # 'path': {'title': 'Path', 'type': 'string', 'format': 'path'}
image: ImagePath # 'image': {'title': 'Image', 'extensions': ['.jpg']}As you can see, ImagePath loses type and format keys from schema.
Originally posted by @laevilgenius in #1065 (comment)
Metadata
Metadata
Assignees
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X