-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Enforce allow_empty=False during partial validation of parent serializer #6512
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
Enforce allow_empty=False during partial validation of parent serializer #6512
Conversation
It looks like this was added in #4222 and there were tests that accompanied it. My guess is that in the time since this was implemented, we covered those test cases from another angle. |
By 'none of the tests added in that PR fail if the associated change is removed', I meant that if I check out c752e96 and remove the changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to give this the approval because 1) tests pass without additional changes 2) it removes an extra special case that we have
Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
e35fee9
to
ec7f7d0
Compare
Thanks. I have rebased the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍looks good to me. Good use of parameterization without overcomplicating the test cases.
👍 |
…zer (encode#6512) Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
…zer (encode#6512) Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
Description
Refs #6509
This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer.
This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid.
This effectively reverts #4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.