Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Django rest swagger views.py only uses first default renderer class #271

Closed
samanehsan opened this issue May 4, 2015 · 1 comment
Closed

Comments

@samanehsan
Copy link

My django rest framework application is using a custom content-type application/vnd.api+json with the following default renderer classes:

'DEFAULT_RENDERER_CLASSES': (
        'api.base.renderers.JSONAPIRenderer',
        'rest_framework.renderers.JSONRenderer',
        'rest_framework.renderers.BrowsableAPIRenderer',
    ),

With this configuration, I get a 406 : NOT ACCEPTABLE error, but if I switch the order of the 'DEFAULT_RENDERER_CLASSES' so that rest_framework.renderers.JSONRenderer is first, then the swagger documentation will render.

I think this might be the cause: https://github.com/marcgibbons/django-rest-swagger/blob/master/rest_framework_swagger/views.py#L22-28

It looks like the view expects rest_framework.renderers.JSONRenderer to be first when ideally, the order should not matter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants