|
|
|
@ -113,7 +113,7 @@ class MatrixUnits(Units):
|
|
|
|
|
"requires_auth": "security" in single_api,
|
|
|
|
|
"rate_limited": 429 in single_api.get("responses", {}),
|
|
|
|
|
"req_params": [],
|
|
|
|
|
"res_params": [],
|
|
|
|
|
"res_tables": [],
|
|
|
|
|
"example": {
|
|
|
|
|
"req": "",
|
|
|
|
|
"res": ""
|
|
|
|
@ -219,16 +219,19 @@ class MatrixUnits(Units):
|
|
|
|
|
res_type = Units.prop(res, "schema/type")
|
|
|
|
|
if res_type and res_type not in ["object", "array"]:
|
|
|
|
|
# response is a raw string or something like that
|
|
|
|
|
endpoint["res_params"].append({
|
|
|
|
|
endpoint["res_tables"].append({
|
|
|
|
|
"title": None,
|
|
|
|
|
"rows": [{
|
|
|
|
|
"key": res["schema"].get("name", ""),
|
|
|
|
|
"type": res_type,
|
|
|
|
|
"desc": res.get("description", "")
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
elif res_type and Units.prop(res, "schema/properties"): # object
|
|
|
|
|
res_tables = get_json_schema_object_fields(res["schema"])
|
|
|
|
|
# TODO: Is this good enough or should we be doing multiple
|
|
|
|
|
# tables for HTTP responses?!
|
|
|
|
|
endpoint["res_params"] = res_tables[0]["rows"]
|
|
|
|
|
for table in res_tables:
|
|
|
|
|
if "no-table" not in table:
|
|
|
|
|
endpoint["res_tables"].append(table)
|
|
|
|
|
|
|
|
|
|
endpoints.append(endpoint)
|
|
|
|
|
|
|
|
|
|