-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] PatchDict errors with inherited schemas #1324
Comments
Possibly related discussion: pydantic/pydantic#4242 |
so problem only appears when you ADD some field ? or always ? |
If I don't add a field it's like Pydantic is considering the two classes equivalent and what I see is that the annotations are the same from the base class. When adding a field, that field is the only one within the annotations dict. |
well I still do not understand you.. can you show two examples working and non working or something... |
The not working example is the one I originally posted, and the application breaks on any path with the error above. Working -- no inheritance: class MySchema(Schema):
name: str
description: str = None
other: str Working -- duplicate all base class fields class ViewableContent(Schema):
name: str
description: str = None
class MySchema(ViewableContent):
name: str = None
description: str = None
other: str Working -- subclassing but no new fields class ViewableContent(Schema):
name: str
description: str = None
class MySchema(ViewableContent):
pass Created an example project with all the examples |
Describe the bug
I have a schema hierarchy such as:
Then add a router like the following:
When I run my application the following error is raised:
Versions:
The text was updated successfully, but these errors were encountered: