Browse Source

🔥 Remove conditional with dataclasses that would only happen in Pydantic v1

pull/14575/head
Sebastián Ramírez 7 months ago
parent
commit
f2f4983199
  1. 3
      fastapi/utils.py

3
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)

Loading…
Cancel
Save