mehcode / config-rs

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

env: add a 'translate_key' field to ease dealing with kebab-case #380

Closed da-x closed 2 years ago

da-x commented 2 years ago

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

let environment = Environment::default()
    .prefix("PREFIX")
    .translate_key(TranslationType::Kebab)
    .separator("__");
da-x commented 2 years ago

@matthiasbeyer, all requested done in another PR to fix branch name mixup. Here: https://github.com/mehcode/config-rs/pull/381