diff --git a/openapi_codec/__init__.py b/openapi_codec/__init__.py index 2c803f4..49a1c9f 100644 --- a/openapi_codec/__init__.py +++ b/openapi_codec/__init__.py @@ -8,7 +8,7 @@ from openapi_codec.decode import _parse_document -__version__ = '1.2.0' +__version__ = '1.2.1' class OpenAPICodec(BaseCodec): diff --git a/openapi_codec/encode.py b/openapi_codec/encode.py index 8c7396a..981f83f 100644 --- a/openapi_codec/encode.py +++ b/openapi_codec/encode.py @@ -123,9 +123,13 @@ def _get_parameters(link, encoding): else: # Expand coreapi fields with location='form' into a single swagger # parameter, with a schema containing multiple properties. + use_type = field.type or 'string' + if use_type == 'file': + use_type = 'string' + schema_property = { 'description': field.description, - 'type': field.type or 'string', + 'type': use_type, } if field.type == 'array': schema_property['items'] = {'type': 'string'}