Commit 1e630e29 authored by janis.streib's avatar janis.streib 🦉
Browse files

UPD: swagger: display return object (#152)

parent 8724ce06
Pipeline #58928 passed with stages
in 4 minutes and 30 seconds
......@@ -195,7 +195,8 @@ def generateParamters(f):
systems = sess.get(
"{scheme}://{base_host}{base_url}/".format(scheme=API_SCHEME, base_host=API_HOST, base_url=API_BASE_URL))
objects = sess.get(
"{scheme}://{base_host}{base_url}/wapi/object_type/list".format(scheme=API_SCHEME, base_host=API_HOST, base_url=API_BASE_URL)).json()[0]
"{scheme}://{base_host}{base_url}/wapi/object_type/list".format(scheme=API_SCHEME, base_host=API_HOST,
base_url=API_BASE_URL)).json()[0]
swagger['tags'] = systems.json()[0]
swagger['securityDefinitions'] = {'api_key': {'type': 'apiKey', 'name': 'Authorization', 'in': 'header'}}
......@@ -209,6 +210,12 @@ swagger['paths'] = {f"/{f['system']}/{f['object_type']}/{f['name']}":
'responses': {
200: {
'description': 'Request erfolgreich',
'schema': {
'type': 'array',
'items': {
'$ref': '#/definitions/' + f['object_type']
}
} if f['is_returning'] else None
},
400: {
'description': 'Eingabefehler',
......
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