You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noted here, it can be useful to validate that keys found in configuration files are known/accepted keys.
I haven't dived very far into how this crate works, but will try to lay out a strategy of how key validation could be supported:
Add a LayerSort descriptor for each layer: default value, read-only file, env, override, validator, etc.
In order to enable key validation, expect that default value layer(s) cover all supported keys
The validator, as a layer / plug-in / function-of-the-Config, will enumerate all keys and report an error for any key from a layer other than default values which does not override a key from a default-value layer.
Hopefully this is clear enough? My primary reason for creating this issue is actually to ask whether there is interest in supporting this — it requires a little more complexity from layers (adding LayerSort, ability to query values from each layer).
The text was updated successfully, but these errors were encountered:
Hm. So key validation as you mention it is really a concern, yes. Right now, the idea would be to rely on the deserialization method for key verification, which would be serde most of the time... serde already supports denying unknown fields - would this suffice?
As noted here, it can be useful to validate that keys found in configuration files are known/accepted keys.
I haven't dived very far into how this crate works, but will try to lay out a strategy of how key validation could be supported:
LayerSort
descriptor for each layer: default value, read-only file, env, override, validator, etc.Config
, will enumerate all keys and report an error for any key from a layer other than default values which does not override a key from a default-value layer.Hopefully this is clear enough? My primary reason for creating this issue is actually to ask whether there is interest in supporting this — it requires a little more complexity from layers (adding
LayerSort
, ability to query values from each layer).The text was updated successfully, but these errors were encountered: