Enforce allow_empty=False during partial validation of parent serializer#6512
Merged
lovelydinosaur merged 1 commit intoencode:masterfrom Jul 1, 2019
Conversation
Contributor
|
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. |
Contributor
Author
|
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 |
kevin-brown
approved these changes
Apr 17, 2019
Contributor
kevin-brown
left a comment
There was a problem hiding this comment.
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
Contributor
Author
|
Thanks. I have rebased the PR. |
rpkilby
reviewed
May 3, 2019
rpkilby
approved these changes
May 3, 2019
Contributor
rpkilby
left a comment
There was a problem hiding this comment.
👍looks good to me. Good use of parameterization without overcomplicating the test cases.
Contributor
|
👍 |
6 tasks
pchiquet
pushed a commit
to pchiquet/django-rest-framework
that referenced
this pull request
Nov 17, 2020
…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.
sigvef
pushed a commit
to sigvef/django-rest-framework
that referenced
this pull request
Dec 3, 2022
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.