mehcode / config-rs

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Apache License 2.0
2.43k stars 206 forks source link

Fail if an unrecognized knob is detected #450

Closed QnJ1c2kNCg closed 10 months ago

QnJ1c2kNCg commented 10 months ago

Is this something like a strict mode, where during the configuration parsing, if a configuration knob is not recognized, the entire Config creation fails?

Thanks!

matthiasbeyer commented 10 months ago

I believe that you can annotate your structs with deny_unknown_fields and when you deserialize to your own types, deserialization should fail if a field is encountered that you didn't expect.

Does this work for you?

QnJ1c2kNCg commented 10 months ago

this is what i needed, thanks!