From 9d74c7001dab08d6deec2d534dba0bea0cd43b25 Mon Sep 17 00:00:00 2001 From: Suyash Vardhan Mathur Date: Sun, 7 Feb 2021 19:34:48 +0530 Subject: [PATCH] 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. --- zerver/lib/markdown/api_return_values_table_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/lib/markdown/api_return_values_table_generator.py b/zerver/lib/markdown/api_return_values_table_generator.py index 5b94e01b48..7005db3a9e 100644 --- a/zerver/lib/markdown/api_return_values_table_generator.py +++ b/zerver/lib/markdown/api_return_values_table_generator.py @@ -77,7 +77,7 @@ class APIReturnValuesTablePreprocessor(Preprocessor): # More correctly, we should be doing something that looks at the types; # print statements and test_api_doc_endpoint is useful for testing. 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 (key_name, key_description) = arr return (spacing * " ") + "* " + key_name + ": " + '' + data_type + " " + key_description