swagger response togirlandi
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
from .rest_framework import *
|
from .rest_framework import *
|
||||||
from .corsheaders import *
|
from .corsheaders import *
|
||||||
from .simple_jwt import *
|
from .simple_jwt import *
|
||||||
|
from .drf_yasg import *
|
||||||
3
config/conf/drf_yasg.py
Normal file
3
config/conf/drf_yasg.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SWAGGER_SETTINGS = {
|
||||||
|
'DEFAULT_MODEL_RENDERING': 'example'
|
||||||
|
}
|
||||||
@@ -22,32 +22,30 @@ class LoginApiView(generics.GenericAPIView, ResponseMixin):
|
|||||||
serializer_class = LoginSerializer
|
serializer_class = LoginSerializer
|
||||||
queryset = User.objects.all()
|
queryset = User.objects.all()
|
||||||
|
|
||||||
# @swagger_auto_schema(
|
@swagger_auto_schema(
|
||||||
# operation_summary="Login",
|
operation_summary="Login",
|
||||||
# responses={
|
responses={
|
||||||
# 200: openapi.Response(
|
200: openapi.Response(
|
||||||
# description="Success",
|
description="Success",
|
||||||
# schema=openapi.Schema(
|
schema=None,
|
||||||
# type=openapi.TYPE_OBJECT
|
examples={
|
||||||
# ),
|
"application/json": {
|
||||||
# examples={
|
"status_code": 200,
|
||||||
# "application/json": {
|
"status": "success",
|
||||||
# "status_code": 200,
|
"message": "User topildi",
|
||||||
# "status": "success",
|
"data": {
|
||||||
# "message": "User topildi",
|
"id": 1,
|
||||||
# "data": {
|
"first_name": "Behruz",
|
||||||
# "id": 1,
|
"last_name": "Xoliqberdiyev",
|
||||||
# "first_name": "Behruz",
|
"region": "nbve",
|
||||||
# "last_name": "Xoliqberdiyev",
|
"is_active": True,
|
||||||
# "region": "nbve",
|
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
|
||||||
# "is_active": True,
|
}
|
||||||
# "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
|
}
|
||||||
# }
|
}
|
||||||
# }
|
)
|
||||||
# }
|
}
|
||||||
# )
|
)
|
||||||
# }
|
|
||||||
# )
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
try:
|
try:
|
||||||
serializer = self.serializer_class(data=request.data)
|
serializer = self.serializer_class(data=request.data)
|
||||||
|
|||||||
Reference in New Issue
Block a user