Commit 85a84aa2 authored by janis.streib's avatar janis.streib 🦉
Browse files

FIX: swagger: bogus representation of string arrays in responses and object types

parent 1e630e29
Pipeline #58929 passed with stages
in 4 minutes and 36 seconds
......@@ -230,16 +230,26 @@ swagger['paths'] = {f"/{f['system']}/{f['object_type']}/{f['name']}":
for f in func_index
}
def renderDataType(d):
dat = {'type': d['dataType']['jsonName'],
'description': d['description']
}
if d['dataType']['apiName'] == 'text_array':
dat['items'] = {
'type': 'string'
}
return dat
swagger['definitions'] = {o['name']:
{
'type': 'object',
'description': o['description'],
'properties': {
a: {
'type': d['dataType']['jsonName'],
'description': d['description']
}
for a, d in o['attributes'].items()}
a: renderDataType(d)
for a, d in o['attributes'].items()
}
}
for o in objects
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment