8000 Merge pull request #18 from core-api/include-type · dd/python-openapi-codec@1943da4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1943da4

Browse files
authored
Merge pull request core-api#18 from core-api/include-type
Include 'type'
2 parents ee10517 + ce56917 commit 1943da4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

openapi_codec/encode.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ def _get_parameters(link, encoding):
115115
'required': field.required,
116116
'in': 'formData',
117117
'description': field.description,
118-
'type': 'string'
118+
'type': field.type or 'string'
119119
}
120120
parameters.append(parameter)
121121
else:
122122
# Expand coreapi fields with location='form' into a single swagger
123123
# parameter, with a schema containing multiple properties.
124124
schema_property = {
125-
'description': field.description
125+
'description': field.description,
126+
'type': field.type or 'string'
126127
}
127128
properties[field.name] = schema_property
128129
if field.required:
@@ -147,7 +148,7 @@ def _get_parameters(link, encoding):
147148
'required': field.required,
148149
'in': location,
149150
'description': field.description,
150-
'type': 'string'
151+
'type': field.type or 'string'
151152
}
152153
parameters.append(parameter)
153154

0 commit comments

Comments
 (0)
0