mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-17 23:52:41 -04:00
✨ When using Pydantic models with __root__ use the internal value in jsonable_encoder (#1524)
This commit is contained in:
1 parent
748bedd37c
commit
8fb755703d
2 files changed
+11
No files matched your search
@@ -71,6 +71,8 @@ def jsonable_encoder(
|
||||
by_alias=by_alias,
|
||||
skip_defaults=bool(exclude_unset or skip_defaults),
|
||||
)
|
||||
if "__root__" in obj_dict:
|
||||
obj_dict = obj_dict["__root__"]
|
||||
return jsonable_encoder(
|
||||
obj_dict,
|
||||
exclude_none=exclude_none,
|
||||
|
||||
Reference in new issue
Block a user