Tags override support (#259)
This commit is contained in:
committed by
Cristi Vîjdea
parent
c52daaea8c
commit
f415a96aa6
+10
-5
@@ -13,7 +13,11 @@ from users.serializers import UserListQuerySerializer, UserSerializerrr
|
||||
class UserList(APIView):
|
||||
"""UserList cbv classdoc"""
|
||||
|
||||
@swagger_auto_schema(query_serializer=UserListQuerySerializer, responses={200: UserSerializerrr(many=True)})
|
||||
@swagger_auto_schema(
|
||||
query_serializer=UserListQuerySerializer,
|
||||
responses={200: UserSerializerrr(many=True)},
|
||||
tags=['Users'],
|
||||
)
|
||||
def get(self, request):
|
||||
queryset = User.objects.all()
|
||||
serializer = UserSerializerrr(queryset, many=True)
|
||||
@@ -28,7 +32,8 @@ class UserList(APIView):
|
||||
'username': openapi.Schema(type=openapi.TYPE_STRING)
|
||||
},
|
||||
),
|
||||
security=[]
|
||||
security=[],
|
||||
tags=['Users'],
|
||||
)
|
||||
def post(self, request):
|
||||
serializer = UserSerializerrr(request.data)
|
||||
@@ -36,17 +41,17 @@ class UserList(APIView):
|
||||
serializer.save()
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||
|
||||
@swagger_auto_schema(operation_id="users_dummy", operation_description="dummy operation")
|
||||
@swagger_auto_schema(operation_id="users_dummy", operation_description="dummy operation", tags=['Users'])
|
||||
def patch(self, request):
|
||||
pass
|
||||
|
||||
|
||||
@swagger_auto_schema(method='put', request_body=UserSerializerrr)
|
||||
@swagger_auto_schema(method='put', request_body=UserSerializerrr, tags=['Users'])
|
||||
@swagger_auto_schema(methods=['get'], manual_parameters=[
|
||||
openapi.Parameter('test', openapi.IN_QUERY, "test manual param", type=openapi.TYPE_BOOLEAN),
|
||||
], responses={
|
||||
200: openapi.Response('response description', UserSerializerrr),
|
||||
})
|
||||
}, tags=['Users'])
|
||||
@api_view(['GET', 'PUT'])
|
||||
def user_detail(request, pk):
|
||||
"""user_detail fbv docstring"""
|
||||
|
||||
Reference in New Issue
Block a user