Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing integration instructions for drf-yasg #505

Merged
merged 2 commits into from
Jan 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion docs/drf_yasg_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ following code to decorate your JWT ``View`` definitions.
from drf_yasg.utils import swagger_auto_schema
from rest_framework import serializers, status
from rest_framework_simplejwt.views import (
TokenObtainPairView, TokenRefreshView, TokenVerifyView)
TokenBlacklistView,
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView,
)


class TokenObtainPairResponseSerializer(serializers.Serializer):
Expand Down Expand Up @@ -69,4 +73,20 @@ following code to decorate your JWT ``View`` definitions.
def post(self, request, *args, **kwargs):
return super().post(request, *args, **kwargs)


class TokenBlacklistResponseSerializer(serializers.Serializer):
def create(self, validated_data):
raise NotImplementedError()

def update(self, instance, validated_data):
raise NotImplementedError()


class DecoratedTokenBlacklistView(TokenBlacklistView):
@swagger_auto_schema(
responses={
status.HTTP_200_OK: TokenBlacklistResponseSerializer})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@swagger_auto_schema(
responses={
status.HTTP_200_OK: TokenBlacklistResponseSerializer})
@swagger_auto_schema(
responses={
status.HTTP_200_OK: TokenBlacklistResponseSerializer,
}
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added line breaks. and, how can I join a team?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, and yup you're in the team! I'll be able to ping y'all with the team mention. Thanks for helping so much!

def post(self, request, *args, **kwargs):
return super().post(request, *args, **kwargs)

.. _drf-yasg: https://github.com/axnsan12/drf-yasg