Skip to content
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

Regression in nested environment paths #291

Closed
conradludgate opened this issue Feb 24, 2022 · 0 comments · Fixed by #292
Closed

Regression in nested environment paths #291

conradludgate opened this issue Feb 24, 2022 · 0 comments · Fixed by #292
Labels

Comments

@conradludgate
Copy link
Contributor

conradludgate commented Feb 24, 2022

In config 0.11, our app used an environment source

Environment::with_prefix("app").separator("__")

Which would match environment vars like APP_TLS__CERTIFICATE (into tls > certificate).

This no longer works due to the group separator using the specified separator, as opposed to always being _ https://github.com/mehcode/config-rs/blob/30d87a311929f5382cb4ecd1de62f20d2dddfb86/src/env.rs#L123

This forces me to update my environments to APP__TLS__CERTIFICATE which is not the end of the world but it slows adoption of the new version.

I'm not sure on the best solution, but maybe there could be a new prefix_separator field. This can be set automatically by the separator method too so that it doesn't break any existing 0.12 apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants