Do not bail on response when request body is formData
parent
b109d4c847
commit
41b1ca4483
|
|
@ -16,7 +16,11 @@
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/testproj" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/testproj" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.pytest_cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/docs/_build" />
|
<excludeFolder url="file://$MODULE_DIR$/docs/_build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/htmlcov" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/src/drf_yasg.egg-info" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3 (drf-yasg)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3 (drf-yasg)" jdkType="Python SDK" />
|
||||||
|
|
|
||||||
|
|
@ -214,8 +214,6 @@ class SwaggerAutoSchema(ViewInspector):
|
||||||
default_schema = self.get_default_response_serializer()
|
default_schema = self.get_default_response_serializer()
|
||||||
|
|
||||||
default_schema = default_schema or ''
|
default_schema = default_schema or ''
|
||||||
if any(is_form_media_type(encoding) for encoding in self.get_consumes()):
|
|
||||||
default_schema = ''
|
|
||||||
if default_schema and not isinstance(default_schema, openapi.Schema):
|
if default_schema and not isinstance(default_schema, openapi.Schema):
|
||||||
default_schema = self.serializer_to_schema(default_schema) or ''
|
default_schema = self.serializer_to_schema(default_schema) or ''
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from rest_framework.response import Response
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
from drf_yasg import openapi
|
from drf_yasg import openapi
|
||||||
from drf_yasg.utils import no_body, swagger_auto_schema
|
from drf_yasg.utils import swagger_auto_schema
|
||||||
from users.serializers import UserListQuerySerializer, UserSerializerrr
|
from users.serializers import UserListQuerySerializer, UserSerializerrr
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,8 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: ''
|
description: ''
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Article'
|
||||||
consumes:
|
consumes:
|
||||||
- multipart/form-data
|
- multipart/form-data
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -225,6 +227,8 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
'201':
|
'201':
|
||||||
description: ''
|
description: ''
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/ImageUpload'
|
||||||
consumes:
|
consumes:
|
||||||
- multipart/form-data
|
- multipart/form-data
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -887,6 +891,32 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
format: uuid
|
format: uuid
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
ImageUpload:
|
||||||
|
required:
|
||||||
|
- image_styles
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
what_am_i_doing:
|
||||||
|
description: test
|
||||||
|
type: string
|
||||||
|
pattern: ^69$
|
||||||
|
default: '69'
|
||||||
|
minLength: 1
|
||||||
|
image_styles:
|
||||||
|
description: Parameter with Items
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- wide
|
||||||
|
- tall
|
||||||
|
- thumb
|
||||||
|
- social
|
||||||
|
upload:
|
||||||
|
description: image serializer help_text
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
|
format: uri
|
||||||
Identity:
|
Identity:
|
||||||
title: Identity
|
title: Identity
|
||||||
type: object
|
type: object
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue