Skip to content

case_sensitive not working for InitSettingsSource #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xbeastx opened this issue Mar 3, 2025 · 2 comments
Open

case_sensitive not working for InitSettingsSource #562

xbeastx opened this issue Mar 3, 2025 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@xbeastx
Copy link

xbeastx commented Mar 3, 2025

case_sensitive not working for InitSettingsSource and for all derived classes (YamlConfigSettingsSource/TomlConfigSettingsSource/JsonConfigSettingsSource).

But it works for EnvSettingsSource and all derived.

from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    model_config = SettingsConfigDict(case_sensitive=False, extra="allow")

    test: str = "default"


settings = Settings(TeSt="override")
print(settings.model_dump())
assert settings.model_dump() == {"test": "override"}
@hramezani
Copy link
Member

Thanks @xbeastx for reporting this. Yes, you are right.

It would be great if you open a PR and update the docs.

@hramezani hramezani added documentation Improvements or additions to documentation and removed unconfirmed labels Mar 12, 2025
@Shindora
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants