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

Added empty serializer classes to fix schema generation #817

Merged
merged 6 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions djoser/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from rest_framework.decorators import action
from rest_framework.exceptions import NotFound
from rest_framework.response import Response
from rest_framework.serializers import Serializer

from djoser import signals, utils
from djoser.compat import get_user_email
Expand All @@ -30,6 +31,7 @@ def _action(self, serializer):
class TokenDestroyView(views.APIView):
"""Use this endpoint to logout user (remove user authentication token)."""

serializer_class = Serializer
permission_classes = settings.PERMISSIONS.token_destroy

def post(self, request):
Expand Down
2 changes: 1 addition & 1 deletion djoser/webauthn/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
urlpatterns = [
re_path(
r"^signup_request/$",
views.SingupRequestView.as_view(),
views.SignupRequestView.as_view(),
name="webauthn_signup_request",
),
re_path(
Expand Down
8 changes: 5 additions & 3 deletions djoser/webauthn/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
User = get_user_model()


class SingupRequestView(APIView):
class SignupRequestView(APIView):
permission_classes = (AllowAny,)
serializer_class = WebauthnSignupSerializer

def post(self, request):
serializer = WebauthnSignupSerializer(data=request.data)
serializer = self.serializer_class(data=request.data)
serializer.is_valid(raise_exception=True)
co = serializer.save()

Expand Down Expand Up @@ -95,9 +96,10 @@ def post(self, request, ukey):

class LoginRequestView(APIView):
permission_classes = (AllowAny,)
serializer_class = WebauthnLoginSerializer

def post(self, request):
serializer = WebauthnLoginSerializer(data=request.data)
serializer = self.serializer_class(data=request.data)
serializer.is_valid(raise_exception=True)
co = CredentialOptions.objects.get(
username=serializer.validated_data["username"]
Expand Down
Loading