I write Web API with django rest framework and django rest swagger.
- django-rest (0.0.1)
- django-rest-swagger (2.1.2)
- djangorestframework (3.6.3)
I try to write Swagger YAML at the view method or APIView method. The method function is okay, and function description rendered okay. But the GET/POST method parameter can not be rendered.
The view method is not using any database model, but customized model.
- How to render customized model field in the parameter section.
- How to render POST body in Swagger UI parameters section.
- The parameter section can not be rendered, how to display it.
P.S. If I write a page with coreapi.Document the parameter could be rendered well. But this way is too complex to API docs. Wishing the YAML would be okay on APIView method or ViewSet methods.
Swagger actually reads that url associated view and check which method it has used for, if it is CreateAPIView (post) then it will show POST method with respect to that URL and then it searches for assigned serializer with that particular view and from there it picks the input fields of associated model. So go step by step if everything is fine in your scenario.