8000 Graceful handling of 'file' fields in JSON links. by tomchristie · Pull Request #27 · core-api/python-openapi-codec · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Graceful handling of 'file' fields in JSON links. #27

Merged
merged 1 commit into from
Dec 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
2 changes: 1 addition & 1 deletion openapi_codec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openapi_codec.decode import _parse_document


__version__ = '1.2.0'
__version__ = '1.2.1'


class OpenAPICodec(BaseCodec):
Expand Down
6 changes: 5 additions & 1 deletion openapi_codec/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down
0