-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
[feature] Optionally Include settings source in ValidationError #544
base: main
Are you sure you want to change the base?
[feature] Optionally Include settings source in ValidationError #544
Conversation
and include missing fields
Thanks @AlbertDeFusco for this PR.
I think we decided to have a flag to print out collected values for each source. |
I can add that. Maybe an env var like |
Looks good. please make another PR for it. BTW, I am not sure we want to add the |
I can agree that validating each source is excessive. I'll work on some alternate implementations to provide source information in the ValidationError |
JFYI, At the point of validation, we don't know which data comes from which sources because |
When working with settings configured for multiple sources it can be hard to pin down the exact source of a validation error. See #538
In this PR I've added a configuration parameter
validate_each_source=True
that performs the validation while constructing the merged state of all configured sources. All validation errors are collected and raised after all sources have been parsed. The settings source is prepended to theloc
field. Further,type=missing
line errors are checked using the fully merged state and added to the raised ValidationError exception.Here is an example using the Init and Env sources.
The following error message is reported