Open dimitrismakris opened 7 years ago
Django REST doesn't render schema for these as I don't believe that they are APIViews. It is possible to override the document generated by the schema generated to include additional "links".
See: http://www.django-rest-framework.org/api-guide/schemas/#schemagenerator
@dimitrismakris I'm not sure if this is the best way to achieve this but I did something like this:
from oauth2_provider.views import TokenView
from rest_framework.views import APIView
class TokenAPIView(TokenView, APIView):
def post(self, *args, **kwargs):
""" DOCS """
return super().post(*args, **kwargs)
You may have to change permissions or authorizations .. but it should make possible to create your docs. Hope it helps
I'm using django-rest-swagger version 2.1.1. I used the oauth2_provider.urls to build the oauth2/token endpoint like this:
The issue is that the Swagger don't detect it as endpoint so it's missing form my openapi.json file.
What can I do to this endpoint in order to be able to detected by Swagger?