Skip to content

Commit

Permalink
Fix is_dataclass typing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
foarsitter committed Sep 16, 2024
1 parent 650692b commit b1b3b05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/requestmodel/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import types
from collections import defaultdict
from collections import deque
from dataclasses import is_dataclass
from dataclasses import is_dataclass, dataclass
from decimal import Decimal
from enum import Enum
from ipaddress import IPv4Address
Expand Down Expand Up @@ -168,7 +168,7 @@ def jsonable_encoder( # noqa: C901
exclude_defaults=exclude_defaults,
sqlalchemy_safe=sqlalchemy_safe,
)
if dataclasses.is_dataclass(obj):
if dataclasses.is_dataclass(obj) and not isinstance(obj, type):
obj_dict = dataclasses.asdict(obj)
return jsonable_encoder(
obj_dict,
Expand Down

0 comments on commit b1b3b05

Please sign in to comment.