We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9038f8f commit a50c88aCopy full SHA for a50c88a
essentials/json.py
@@ -20,9 +20,9 @@ def default(self, obj: Any) -> Any:
20
try:
21
return json.JSONEncoder.default(self, obj)
22
except TypeError:
23
+ if hasattr(obj, "model_dump"):
24
+ return obj.model_dump()
25
if hasattr(obj, "dict"):
- if hasattr(obj, "model_dump"):
- return obj.model_dump()
26
return obj.dict()
27
if isinstance(obj, time):
28
return obj.strftime("%H:%M:%S")
0 commit comments