From 8942d11a7283b638a78c1cac647462658e010e12 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 20 Jul 2022 15:06:16 -0700 Subject: [PATCH] openapi: Simplify other render functions. Signed-off-by: Anders Kaseorg --- zerver/openapi/markdown_extension.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/zerver/openapi/markdown_extension.py b/zerver/openapi/markdown_extension.py index a183a06501..2af3a48365 100644 --- a/zerver/openapi/markdown_extension.py +++ b/zerver/openapi/markdown_extension.py @@ -526,11 +526,9 @@ class ResponseDescriptionPreprocessor(BasePreprocessor): super().__init__(MACRO_REGEXP_RESPONSE_DESC, md, config) def render(self, function: str) -> List[str]: - description: List[str] = [] path, method = function.rsplit(":", 1) raw_description = get_responses_description(path, method) - description.extend(raw_description.splitlines()) - return description + return raw_description.splitlines() class ParameterDescriptionPreprocessor(BasePreprocessor): @@ -538,11 +536,9 @@ class ParameterDescriptionPreprocessor(BasePreprocessor): super().__init__(MACRO_REGEXP_PARAMETER_DESC, md, config) def render(self, function: str) -> List[str]: - description: List[str] = [] path, method = function.rsplit(":", 1) raw_description = get_parameters_description(path, method) - description.extend(raw_description.splitlines()) - return description + return raw_description.splitlines() def makeExtension(*args: Any, **kwargs: str) -> APIMarkdownExtension: