Closed chuckyblack closed 4 months ago
Thanks for reporting this.
pydantic-settings
convert all the env variables to lowercase if case_sensitivity=False
(the default). that's why it can't find value for the field nestedNested
.
This was the default behavior on V1
and we keep it on V2
. So, we can't change it in V2
Is there any reason why this can't be fixed?
What about solution where the field name nestedNested
would be coverted to lowercase too during matching?
Is there any reason why this can't be fixed?
I think it needs a big change in pydantic-settings
and it can't be done in V2
because it will introduce some breaking changes.
What about solution where the field name nestedNested would be coverted to lowercase too during matching?
This is also happening. That's why you see the lowercase fieldname in error input_value={'nestednested': {'var1': 'test'}}
but pydantic needs the real field name nestedNested
@chuckyblack
I created https://github.com/pydantic/pydantic-settings/pull/294 to fix the problem.
Could you please confirm it?
Great, it's working. @hramezani Could you release a new version, please?
This will be included in the new release. I am trying to prepare a new release in couple of days
How to reproduce:
requirements.txt
config.py
This throws error:
If I change
case_sensitivity=True
, it works fine.