File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/common-library/src/common_library Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11from datetime import timedelta
22from typing import Any
33
4- from common_library .pydantic_fields_extension import get_type
5- from pydantic import BaseModel , SecretStr
4+ from pydantic import BaseModel , SecretStr , TypeAdapter
65from pydantic_core import Url
76
87
@@ -29,10 +28,10 @@ def model_dump_with_secrets(
2928 data [field_name ] = str (field_data )
3029
3130 elif isinstance (field_data , dict ):
32- field_type = get_type ( settings_obj .model_fields [field_name ])
33- if field_type and issubclass ( field_type , BaseModel ) :
31+ field_type = settings_obj .model_fields [field_name ]. annotation
32+ if field_type :
3433 data [field_name ] = model_dump_with_secrets (
35- field_type . model_validate (field_data ),
34+ TypeAdapter ( field_type ). validate_python (field_data ),
3635 show_secrets = show_secrets ,
3736 ** pydantic_export_options ,
3837 )
You can’t perform that action at this time.
0 commit comments