From 3d24369633238657117de8c164e020818653f861 Mon Sep 17 00:00:00 2001 From: chbndrhnns Date: Fri, 18 Jul 2025 17:52:41 +0200 Subject: [PATCH] Catch UserWarning for v1 models --- fastapi/_compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/_compat.py b/fastapi/_compat.py index dd748dfac..f7f80e090 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -114,7 +114,7 @@ if PYDANTIC_V2: self._type_adapter: TypeAdapter[Any] = TypeAdapter( Annotated[self.field_info.annotation, self.field_info] ) - except PydanticDeprecatedSince20: + except UserWarning: pass def get_default(self) -> Any: