Update api spec (#202)

* YOYO NEW API SPEC!

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
zoo-github-actions-auth[bot]
2024-03-04 12:53:31 -08:00
committed by GitHub
parent a3089ef956
commit 042bb964e5
69 changed files with 3505 additions and 5458 deletions

View File

@ -1577,7 +1577,7 @@ def generateObjectTypeCode(
description = ""
if "description" in schema:
description = schema["description"]
description = schema["description"].replace('"', '\\"')
imports = []
refs = getRefs(schema)
@ -1801,6 +1801,11 @@ def getRequestBodyRefs(endpoint: dict) -> List[str]:
if "$ref" in form:
ref = form["$ref"].replace("#/components/schemas/", "")
refs.append(ref)
elif content_type == "multipart/form-data":
form = content[content_type]["schema"]
if "$ref" in form:
ref = form["$ref"].replace("#/components/schemas/", "")
refs.append(ref)
else:
# Throw an error for an unsupported content type.
logging.error("content: ", content)
@ -1839,6 +1844,15 @@ def getRequestBodyTypeSchema(
elif form != {}:
logging.error("not a ref: ", form)
raise Exception("not a ref")
elif content_type == "multipart/form-data":
form = content[content_type]["schema"]
if "$ref" in form:
ref = form["$ref"].replace("#/components/schemas/", "")
type_schema = data["components"]["schemas"][ref]
return ref, type_schema
elif form != {}:
type_schema = form
return None, type_schema
else:
logging.error("unsupported content type: ", content_type)
raise Exception("unsupported content type")