-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
POST list data breaks all Views / ViewSets #5637
Comments
If anyone's looking through the issues and wants to contribute... first thing we need to do here is see if someone else can reproduce and confirm the issue. |
@FeroxTL This isn't specific enough to be actionable at the moment.
So we need more to be able to reproduce this. (Most likely there's an error elsewhere in your code, but without the exception it's impossible to say...) I'm going to close this as is. Happy to re-open if we can identify a concrete issue. |
@carltongibson As far as I can see this bug exists in render_form_for_serializer that is used only in Browsable API. So when it gets a list instead of dict is fails. If Browsable API is turned off (for example
) this would not be affected. By default it is on. You need to activate Browsable API (if it is off) and try again. I have created repo with simple test, that shows this bug — https://github.com/FeroxTL/rest_test |
Thanks @FeroxTL. I'm reopening this, given the reproduction/test. |
Checklist
master
branch of Django REST framework.List data makes any view / viewset crash.
I tested versions from 3.6.3 till 3.7.3 (current pypi) and master.
Steps to reproduce
Just create simple ApiView / Viewset and serializer (does not matter Serializer or ModelSerializer)
then post JSON data (any array):
[{}]
You get stack trace:
Expected behavior
Validation input data type?
Actual behavior
500
The text was updated successfully, but these errors were encountered: