We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When a subclass of a BaseModel sets extra=forbid all attributes of the parent class are marked as "not permitted" on initialization.
BaseModel
extra=forbid
To Reproduce
from pydantic import BaseModel, Extra class A(BaseModel): id: int class B(A): data: List[int] class Config: extra = Extra.forbid d = B(id=1, data=[1,2,3])
id is now reported as: 'id' extra fields not permitted
id
'id' extra fields not permitted
Expected behavior Attributes inherited from parent class should not be reported as "not permitted"
Screenshots
Environments (please complete the following information):
Additional context Reporting detection of not permitted extra fields was introduced by #324 I guess inheritance wasn't considered.
Thanks a lot for this wonderful plugin 😃
The text was updated successfully, but these errors were encountered:
@finswimmer I'm sorry that I forget to say the fixed version had been released 🙇
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When a subclass of a
BaseModel
setsextra=forbid
all attributes of the parent class are marked as "not permitted" on initialization.To Reproduce
id
is now reported as:'id' extra fields not permitted
Expected behavior
Attributes inherited from parent class should not be reported as "not permitted"
Screenshots
Environments (please complete the following information):
Additional context
Reporting detection of not permitted extra fields was introduced by #324 I guess inheritance wasn't considered.
Thanks a lot for this wonderful plugin 😃
The text was updated successfully, but these errors were encountered: