Fix bad test for no_body
parent
591c12f1a7
commit
b109d4c847
|
|
@ -15,7 +15,7 @@ from articles.models import Article
|
|||
from drf_yasg import openapi
|
||||
from drf_yasg.app_settings import swagger_settings
|
||||
from drf_yasg.inspectors import CoreAPICompatInspector, FieldInspector, NotHandled, SwaggerAutoSchema
|
||||
from drf_yasg.utils import swagger_auto_schema
|
||||
from drf_yasg.utils import no_body, swagger_auto_schema
|
||||
|
||||
|
||||
class DjangoFilterDescriptionInspector(CoreAPICompatInspector):
|
||||
|
|
@ -133,6 +133,7 @@ class ArticleViewSet(viewsets.ModelViewSet):
|
|||
"""
|
||||
pass
|
||||
|
||||
@swagger_auto_schema(request_body=no_body, operation_id='no_body_test')
|
||||
def update(self, request, *args, **kwargs):
|
||||
"""update method docstring"""
|
||||
return super(ArticleViewSet, self).update(request, *args, **kwargs)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class UserList(APIView):
|
|||
serializer.save()
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||
|
||||
@swagger_auto_schema(request_body=no_body, operation_id="users_dummy", operation_description="dummy operation")
|
||||
@swagger_auto_schema(operation_id="users_dummy", operation_description="dummy operation")
|
||||
def patch(self, request):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -134,14 +134,9 @@ paths:
|
|||
tags:
|
||||
- articles
|
||||
put:
|
||||
operationId: articles_update
|
||||
operationId: no_body_test
|
||||
description: update method docstring
|
||||
parameters:
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/Article'
|
||||
parameters: []
|
||||
responses:
|
||||
'200':
|
||||
description: ''
|
||||
|
|
|
|||
Loading…
Reference in New Issue