From f2f4983199e9e7c77b4edccd380855efca5ca6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 20 Dec 2025 14:18:30 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20conditional=20with=20da?= =?UTF-8?q?taclasses=20that=20would=20only=20happen=20in=20Pydantic=20v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/utils.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/fastapi/utils.py b/fastapi/utils.py index 425ac1fbd..42feb171c 100644 --- a/fastapi/utils.py +++ b/fastapi/utils.py @@ -1,7 +1,6 @@ import re import warnings from collections.abc import MutableMapping -from dataclasses import is_dataclass from typing import ( TYPE_CHECKING, Any, @@ -150,8 +149,6 @@ def create_cloned_field( cloned_types = _CLONED_TYPES_CACHE original_type = field.type_ - if is_dataclass(original_type) and hasattr(original_type, "__pydantic_model__"): - original_type = original_type.__pydantic_model__ use_type = original_type if lenient_issubclass(original_type, v1.BaseModel): original_type = cast(type[v1.BaseModel], original_type)