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