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
Errors from parent-level validation of nested serializer fields break the browsable API. #4073
Open
6 tasks done
Labels
Comments
alexcreid
added a commit
to alexcreid/django-rest-framework
that referenced
this issue
Apr 27, 2016
Confirmed - thanks for raising the issue. Using the following...
Submitting the form results in... |
tomchristie
changed the title
Errors from parent-level validation of nested serializer fields breaks the form-like API
Errors from parent-level validation of nested serializer fields break the browsable API.
Jun 1, 2016
tomchristie
modified the milestones:
3.4.2 Release,
3.4.3 Release,
3.4.4 Release,
3.4.5 Release
Aug 5, 2016
tomchristie
modified the milestones:
3.5.4 Release,
3.6.1 Release,
3.6.2 Release,
3.6.3 Release
Mar 7, 2017
I'm going to de-milestone this for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
master
branch of Django REST framework.Steps to reproduce
(See PR #4074 for a test that reproduces this.)
validate_<field name>
method.validate_<field name>
method to fail.<serializer instance>[<field name>]
)Expected behaviour
A BoundField is returned.
Actual behaviour
An AttributeError is raised, as the NestedBoundField attempts to treat its
errors
as a dictionary, even though they are the list of error messages from the parent serialiser's validation error. This impacts the browsable API.(It's not entirely clear to me what the behaviour should be where a nested serialiser has a list of errors rather than a dictionary, but it probably shouldn't be to error out.)
The text was updated successfully, but these errors were encountered: