fix OpenAPI data type errors

This commit is contained in:
Tom Kralidis
2019-02-19 01:03:17 +00:00
parent 4753426e42
commit fd761a967d
+17 -3
View File
@@ -199,13 +199,27 @@ def get_oas_30(cfg):
for k2, v2 in p.fields.items():
path_ = '{}/items'.format(collection_name_path)
if v2['type'] == 'date':
schema = {
'type': 'string',
'format': 'date'
}
elif v2['type'] == 'float':
schema = {
'type': 'number',
'format': 'float'
}
else:
schema = {
'type': v2['type']
}
paths['{}'.format(path_)]['get']['parameters'].append({
'name': k2,
'in': 'query',
'required': False,
'schema': {
'type': v2['type'],
},
'schema': schema,
'style': 'form',
'explode': False
})