Django REST framework JSON API with Swagger – Upwork

This job is to solve an issue, it has been posted on git hub with no answers. Here is the description:

Using django-rest-framework-json-api I am able to create API end points that work as described within the documentation. Attempted to provide API documentation using django-rest-swagger is not so easy.

1: Swagger uses media_type = 'application/json' which is not supported in the JSON API. To get around this I created a second render class (renderer_classes) that sub classes the JSON API JSONRenderer and forces the media type.

Now the end point supports application/json and application/vnd.api+json and swagger is happy to render in JSON API document structure. Aware that the generated curl requests have none a standard JSON API header.

2: Swagger has the same issue with the parser. While the work out from issue 1 does work there is a secondary challenge. Swagger renders a flat dictionary of field names which is not JSON API and ultimately is requested by DRF.

Is it possible to get swagger to parse in JSON API? At the moment Swagger is not working for PUT or POST.

python 3.6

Need this solved within a week (7 days after accepting) if you take longer then a week with no results I will terminate. Dont like it when people pick up jobs and do not have the time to action them.

Budget: $200

Posted On: June 04, 2018 08:24 UTC
Category: Web, Mobile & Software Dev > Web Development

Country: Australia
click to applyPosted on