From 342021c587321d02a8bf3f6fec506ec1d4eddcd0 Mon Sep 17 00:00:00 2001 From: Max <37951044+miloserdev@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:55:38 +0300 Subject: [PATCH] type to isinstance --- fastapi/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 0eb60d71a..b0945898b 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -533,7 +533,7 @@ class APIRoute(routing.Route): # truncate description text to the content preceding the first "form feed" self.description = ( self.description.split("\f")[0].strip() - if type(self.description) is str + if isinstance(self.description, str) else self.description ) response_fields = {}