-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
RFC: Propagate unknown
value through nested schemas?
#980
Comments
I think it's good idea to add fields.Nested.unknown="inherit", which can be set explicitly, but in most cases what I see you don't want to propagate by default, for example you have http json response, which can have various fields, but if field is nested it will be binded to specific entity, and you want to be sure that fields are strict there, so it's each entity (schema) responsibility to react to unknown fields, not related to parent. |
It would be nice to have the option to have all nested schemas inherit. |
For now, our stance is that class Meta options should not be automagically propagated to nested fields. Users should use an base schema class in order to share default options across classes. |
I do agree that class Meta options should not be automatically propagated. However, what about when overriding |
At the very least, this behavior should be documented. |
I really agree with the previous pro-comments.
Which is very much what I'd have expected for nested fields, what the documentation confirms, which however doesn't happen. Either way: How to solve that? I'm having List() and Item(). |
So what is the solution for this? |
I'm wondering if the
unknown
value set on parent schema should propagate down through all nested schemas.We raise by default, and to change that, one needs to let all his schemas specify another behaviour (
this is broken but will be fixed when #963 is merged). This can be done with a custom schema to use as a base for all schemas, so it is feasible, and raise is a sensible default IMHO, but wouldn't it make sense to let the parent schemaunknown
setting propagate?The text was updated successfully, but these errors were encountered: