Add security requirements handling (#54)
* Add security requirements handling * Update swagger-ui to 3.9.2, ReDoc to 1.20.0 Closes #39.
This commit is contained in:
+11
-7
@@ -19,13 +19,17 @@ class UserList(APIView):
|
||||
serializer = UserSerializerrr(queryset, many=True)
|
||||
return Response(serializer.data)
|
||||
|
||||
@swagger_auto_schema(operation_description="apiview post description override", request_body=openapi.Schema(
|
||||
type=openapi.TYPE_OBJECT,
|
||||
required=['username'],
|
||||
properties={
|
||||
'username': openapi.Schema(type=openapi.TYPE_STRING)
|
||||
},
|
||||
))
|
||||
@swagger_auto_schema(
|
||||
operation_description="apiview post description override",
|
||||
request_body=openapi.Schema(
|
||||
type=openapi.TYPE_OBJECT,
|
||||
required=['username'],
|
||||
properties={
|
||||
'username': openapi.Schema(type=openapi.TYPE_STRING)
|
||||
},
|
||||
),
|
||||
security=[]
|
||||
)
|
||||
def post(self, request):
|
||||
serializer = UserSerializerrr(request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
Reference in New Issue
Block a user