From 7a667ed02175df7f8e7129bdf6c64b4afe409344 Mon Sep 17 00:00:00 2001 From: Max <37951044+miloserdev@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:40:40 +0300 Subject: [PATCH] Allow use any description type --- fastapi/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 457481e32..ca589f487 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -531,7 +531,7 @@ class APIRoute(routing.Route): self.description = description or inspect.cleandoc(self.endpoint.__doc__ or "") # if a "form feed" character (page break) is found in the description text, # truncate description text to the content preceding the first "form feed" - self.description = self.description.split("\f")[0].strip() + self.description = self.description.split("\f")[0].strip() if type(self.description) is str else self.description response_fields = {} for additional_status_code, response in self.responses.items(): assert isinstance(response, dict), "An additional response must be a dict"