I'm trying to apply this fix on my django rest framework Adding root element to json response (django-rest-framework)
But I'm not sure how to override the json serializer on django rest framework, any help would be great.
The end result would be to have the root node name on the Json, because right now it's just an array of objects without the root name i.e.
not it looks like this
[{"foo":"bar"}]
I would need it to be like this
{"element": [{"foo":"bar"}]}
to get it to work with Ember JS
Thanks
I think you have your answer there in the post you've given.
You need to define custom JSON renderer
and use it as default renderer either in settings or as an explicitly defined render for you view, like: