Handle inputs that need arrays

This commit is contained in:
Paul
2024-06-27 15:20:21 +00:00
parent b763c59898
commit 6f16395989
2 changed files with 36 additions and 10 deletions
+10
View File
@@ -108,6 +108,16 @@ def order_inputs(input_types, input_schema):
return ordered_input_types
def inputs_that_need_arrays(schema):
openapi_schema = schema["latest_version"]["openapi_schema"]
input_schema = openapi_schema["components"]["schemas"]["Input"]
array_inputs = []
for prop_name, prop_data in input_schema["properties"].items():
if prop_data.get("type") == "array":
array_inputs.append(prop_name)
return array_inputs
def get_return_type(schema):
image_extensions = (".png", ".jpg", ".jpeg", ".gif", ".webp")
openapi_schema = schema["latest_version"]["openapi_schema"]