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

env: add a 'convert_case' field to ease dealing with kebab-case #381

Closed da-x closed 1 year ago

da-x commented 1 year ago

This allows usage of kebab-case attribute in serde, mapping unambiguously into a config value given a multiple character separator.

This also add the convert-case feature.

For example:

let environment = Environment::default()
    .prefix("PREFIX")
    .translate_key(Case::Kebab)
    .separator("__");