diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 7b951c6eb..0af7510cd 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -465,6 +465,13 @@ class AutoSchema(ViewInspector): def _get_responses(self, path, method): # TODO: Handle multiple codes and pagination classes. + if method == 'DELETE': + return { + '204': { + 'description': '' + } + } + item_schema = {} serializer = self._get_serializer(path, method) @@ -485,13 +492,6 @@ class AutoSchema(ViewInspector): else: response_schema = item_schema - if method == 'DELETE': - return { - '204': { - 'description': '' - } - } - return { '200': { 'content': {