@@ -115,16 +115,26 @@ def _get_parameters(link, encoding):
115
115
'required' : field .required ,
116
116
'in' : 'formData' ,
117
117
'description' : field .description ,
118
- 'type' : field .type or 'string'
119
118
}
119
+ if field .type :
120
+ parameter ['type' ] = field .type
121
+ if field .type == 'array' :
122
+ parameter ['items' ] = {'type' : 'string' }
123
+ else :
124
+ parameter ['type' ] = 'string'
120
125
parameters .append (parameter )
121
126
else :
122
127
# Expand coreapi fields with location='form' into a single swagger
123
128
# parameter, with a schema containing multiple properties.
124
129
schema_property = {
125
130
'description' : field .description ,
126
- 'type' : field .type or 'string'
127
131
}
132
+ if field .type :
133
+ schema_property ['type' ] = field .type
134
+ if field .type == 'array' :
135
+ schema_property ['items' ] = {'type' : 'string' }
136
+ else :
137
+ schema_property ['type' ] = 'string'
128
138
properties [field .name ] = schema_property
129
139
if field .required :
130
140
required .append (field .name )
@@ -148,8 +158,13 @@ def _get_parameters(link, encoding):
148
158
'required' : field .required ,
149
159
'in' : location ,
150
160
'description' : field .description ,
151
- 'type' : field .type or 'string'
152
161
}
162
+ if field .type :
163
+ parameter ['type' ] = field .type
164
+ if field .type == 'array' :
165
+ parameter ['items' ] = {'type' : 'string' }
166
+ else :
167
+ parameter ['type' ] = 'string'
153
168
parameters .append (parameter )
154
169
155
170
if properties :
0 commit comments