Skip to content

UpperCamel Case fails to capitalize first word immediately after a multilevel separator in Environment. #693

@dtessman

Description

@dtessman
let mut builder = Config::builder()
.add_source(File::with_name(&config_path).format(FileFormat::Json).required(false))              .add_source(Environment::default().prefix("CONFIG").prefix_separator("_").separator("__").convert_case(Case::UpperCamel));

If the file contains:

Otel {
            Endpoint: "FROM FILE"
}

And the environment variable "CONFIG_OTEL__ENDPOINT" equals "FROM ENV"

getting "Otel.Endpoint" will equal "FROM FILE" and "Otel.endpoint" will equal "FROM ENV" rather than the environment overriding the file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions