pydantic / pydantic-settings

Settings management using pydantic
https://docs.pydantic.dev/latest/usage/pydantic_settings/
MIT License
593 stars 61 forks source link

Desynchronization of the extra field documentation between ConfigDict and default creation of model_config #264

Closed utkini closed 6 months ago

utkini commented 6 months ago

Hello!

I think I found a small mistake in method documentation:

pydantic says that the extra parameter will be ignore by default, but

pydantic_settings sets this extra parameter to forbid by default

sydney-runkle commented 6 months ago

@utkini, thanks for reporting this!

@hramezani, could you take a look at this discrepancy? Thanks!

hramezani commented 6 months ago

It is not a mistake. it is a design decision to raise ValidationError in case of extra values

utkini commented 6 months ago

Got it, I rather wanted to suggest, maybe change the description of this parameter to forbid here?

hramezani commented 6 months ago

This is for pydantic-settings and pydantic has different extra default. So, no need to change the description on pydantic.