fix OpenAPI data type errors
This commit is contained in:
+17
-3
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user