mirror of https://github.com/zulip/zulip.git
api docs: Fix non-rendering response parameter data types.
The current logic doesn't display data types when the additionalProperties variables are not object, but are array of strings, etc. Changed the if condition to allow rendering in such cases.
This commit is contained in:
parent
e341a81987
commit
9d74c7001d
|
@ -77,7 +77,7 @@ class APIReturnValuesTablePreprocessor(Preprocessor):
|
||||||
# More correctly, we should be doing something that looks at the types;
|
# More correctly, we should be doing something that looks at the types;
|
||||||
# print statements and test_api_doc_endpoint is useful for testing.
|
# print statements and test_api_doc_endpoint is useful for testing.
|
||||||
arr = description.split(": ", 1)
|
arr = description.split(": ", 1)
|
||||||
if data_type != "object" or len(arr) == 1 or '\n' in arr[0]:
|
if len(arr) == 1 or '\n' in arr[0]:
|
||||||
return (spacing * " ") + "* " + description
|
return (spacing * " ") + "* " + description
|
||||||
(key_name, key_description) = arr
|
(key_name, key_description) = arr
|
||||||
return (spacing * " ") + "* " + key_name + ": " + '<span class="api-response-datatype">' + data_type + "</span> " + key_description
|
return (spacing * " ") + "* " + key_name + ": " + '<span class="api-response-datatype">' + data_type + "</span> " + key_description
|
||||||
|
|
Loading…
Reference in New Issue