Selaa lähdekoodia

add support for swagger object type (#3426)

Co-authored-by: lipeikui <lipeikui@3vjia.com>
tags/0.6.4
LeePui 1 vuosi sitten
vanhempi
commit
38ca3b29b5
No account linked to committer's email address
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10
    0
      api/core/tools/tool/api_tool.py

+ 10
- 0
api/core/tools/tool/api_tool.py Näytä tiedosto

@@ -291,6 +291,16 @@ class ApiTool(Tool):
elif property['type'] == 'null':
if value is None:
return None
elif property['type'] == 'object':
if isinstance(value, str):
try:
return json.loads(value)
except ValueError:
return value
elif isinstance(value, dict):
return value
else:
return value
else:
raise ValueError(f"Invalid type {property['type']} for property {property}")
elif 'anyOf' in property and isinstance(property['anyOf'], list):

Loading…
Peruuta
Tallenna