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)