fixed generator (#738)

Signed-off-by: saimedhi <[email protected]>
This commit is contained in:
Sai Medhini Reddy Maryada
2024-05-01 16:59:17 -04:00
committed by GitHub
parent 0caacf870c
commit 9a67bbfd16
5 changed files with 48 additions and 12 deletions
+18 -9
View File
@@ -731,15 +731,24 @@ def read_modules() -> Any:
]["required"]
}
)
q = data["components"]["requestBodies"][requestbody_ref]["content"][
"application/json"
][
"schema"
] # pylint: disable=invalid-name
if "description" in q:
body.update({"description": q["description"]})
if "x-serialize" in q:
body.update({"serialize": q["x-serialize"]})
if (
"application/x-ndjson"
in data["components"]["requestBodies"][requestbody_ref][
"content"
]
):
requestbody_schema = data["components"]["requestBodies"][
requestbody_ref
]["content"]["application/x-ndjson"]["schema"]
body.update({"serialize": True})
else:
requestbody_schema = data["components"]["requestBodies"][
requestbody_ref
]["content"]["application/json"]["schema"]
if "description" in requestbody_schema:
body.update({"description": requestbody_schema["description"]})
api.update({"body": body})