openapi: Fix return values in delete-queue endpoint.

The check for whether to do the special GET /events logic was
incorrectly also covering DELETE /events.
This commit is contained in:
Suyash Vardhan Mathur 2021-06-23 15:21:50 +05:30 committed by Tim Abbott
parent fe07f67360
commit ad9d1c0f80
1 changed files with 3 additions and 3 deletions

View File

@ -43,15 +43,15 @@ class APIReturnValuesTablePreprocessor(Preprocessor):
return_values: Dict[str, Any] = {}
return_values = get_openapi_return_values(endpoint, method)
text: List[str] = []
if endpoint != "/events":
text = self.render_table(return_values, 0)
else:
if doc_name == "/events:get":
return_values = copy.deepcopy(return_values)
events = return_values["events"].pop("items", None)
text = self.render_table(return_values, 0)
# Another heading for the events documentation
text.append("\n\n## Events\n\n")
text += self.render_events(events)
else:
text = self.render_table(return_values, 0)
if len(text) > 0:
text = ["#### Return values"] + text
line_split = REGEXP.split(line, maxsplit=0)