Bug in GenericAPIView where Browsable API fails to run if serialized nested dictionary #7959
Unanswered
dracarys-github
asked this question in
Potential Issue
Replies: 2 comments 8 replies
-
from our discussion
Personally, I don't think this is an issue with the DRF or Browsable API, rather than an implementation issue. |
Beta Was this translation helpful? Give feedback.
8 replies
-
@tomchristie For your reference, here is the error image |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
DRF Browsable API fails to run if the serialized data contains nested dictionaries when the both the get and post method is written:
Data being serialized is in the following format:
This does not work:
This works
This also works
For more detailed explanation, you can refer to this stackoverflow post: https://stackoverflow.com/questions/67329800/drf-browsable-api-make-sure-it-works-when-dictionary-is-passed-to-a-get-respon
For a reproducible example you can use this project: https://github.com/dracarys-github/sample_SO_ref
(Just run the project and go to the link localhost:8000/item_mast to reproduce the error)
UPDATE
It was found that the POST method adds extra inputs and a form when using GenericAPIView, I think DRF Web API should be made compatible to handle dictionaries being serialised.
Beta Was this translation helpful? Give feedback.
All reactions