django-rest-swagger
django-rest-swagger copied to clipboard
Can't not work with swagger.js
swagger.js hardcodes the request http header Accept: application/json
, so it will return 406 Not Acceptable
, when request from http://mydomain/schema/?format=openapi
, because its repsonse Header is Content-Type: application/openapi+json
. So, Can we change the Content-Type
to application/json
. Thanks.
class MyView(View):
def get(self, request, *args, **kwargs):
response = schema_view(request)
response["Content-Type"] = "application/json"
return response
This does not work. Content-type
seems to be hardcoded.
https://github.com/swagger-api/swagger-js/issues/1430