Skip to content

Commit 0b7e719

Browse files
fix
1 parent 1ce4766 commit 0b7e719

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/common-library/src/common_library/serialization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from datetime import timedelta
2-
from typing import Any
2+
from typing import Any, get_origin
33

44
from pydantic import BaseModel, SecretStr
55
from pydantic_core import Url
66

7-
from .pydantic_fields_extension import get_type
8-
97

108
def model_dump_with_secrets(
119
settings_obj: BaseModel, *, show_secrets: bool, **pydantic_export_options
@@ -31,7 +29,9 @@ def model_dump_with_secrets(
3129
data[field_name] = str(field_data)
3230

3331
elif isinstance(field_data, dict):
34-
field_type = get_type(settings_obj.model_fields[field_name])
32+
field_type = get_origin(settings_obj.model_fields[field_name].annotation)
33+
if not field_type:
34+
break
3535
if issubclass(field_type, BaseModel):
3636
data[field_name] = model_dump_with_secrets(
3737
field_type.model_validate(field_data),

0 commit comments

Comments
 (0)