I'm developing a REST API with Django 1.11 and Django REST Framework 3.7. I installed Django REST Swagger 2.1 to generate the documentation.
I'm using a function-based view like this:
from rest_framework.decorators import api_view, permission_classes
@api_view(['POST'])
@permission_classes((permissions.AllowAny,))
def jwt_auth(request, provider, format=None):
"""
View description here
"""
pass
As you can see, my view is recognized by Swagger and it has the correct description: "View description here".
However:
- You can see the "Description" column is empty for the
provider
URL parameter. - The POST parameters are not documented (obviously, because there is no way for Swagger to know them)
How can I write documentation for the URL and POST parameters of a function-based view, as well as the responses?
I tried YAML Docstrings but it seems it's for the old version (0.3.x) and it doesn't work with version 2.x.