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 ffb3ac6 commit c56f430Copy full SHA for c56f430
pydantic_settings/sources/providers/env.py
@@ -186,7 +186,10 @@ class Cfg(BaseSettings):
186
type_has_key = self.next_field(type_, key, case_sensitive)
187
if type_has_key:
188
return type_has_key
189
- if is_model_class(annotation) or is_pydantic_dataclass(annotation): # type: ignore[arg-type]
+ if _lenient_issubclass(get_origin(annotation), dict):
190
+ # get value type if it's a dict
191
+ return get_args(annotation)[-1]
192
+ elif is_model_class(annotation) or is_pydantic_dataclass(annotation): # type: ignore[arg-type]
193
fields = _get_model_fields(annotation)
194
# `case_sensitive is None` is here to be compatible with the old behavior.
195
# Has to be removed in V3.
0 commit comments