Skip to content

Regression in nested environment paths #291

@conradludgate

Description

@conradludgate

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions