Fix bad test for no_body

openapi3
Cristi Vîjdea 2018-09-09 23:11:10 +03:00
parent 591c12f1a7
commit b109d4c847
3 changed files with 5 additions and 9 deletions

View File

@ -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)

View File

@ -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

View File

@ -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: ''