Skip to content

fix(env): apply convert_case to each nested key segment#754

Open
SAY-5 wants to merge 2 commits into
rust-cli:mainfrom
SAY-5:fix-env-convert-case-nested
Open

fix(env): apply convert_case to each nested key segment#754
SAY-5 wants to merge 2 commits into
rust-cli:mainfrom
SAY-5:fix-env-convert-case-nested

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

When Environment::convert_case is combined with separator, the case conversion was applied to the whole dotted key at once, so convert_case quirks (e.g. UpperCamel not capitalizing words after a .) produced inconsistent segments like Otel.endpoint and broke overrides of file-sourced values. This converts each .-separated segment independently. Closes #693

@SAY-5 SAY-5 changed the base branch from master to main May 12, 2026 23:31
@epage
Copy link
Copy Markdown
Contributor

epage commented May 13, 2026

Interesting that convert_case considers . to be part of the word.

Note that we would prefer a fairly specific commit structure as noted in our contrib guide. See also https://epage.github.io/dev/pr-style/#c-test.

@SAY-5 SAY-5 force-pushed the fix-env-convert-case-nested branch from b4ddb38 to c2920ac Compare May 13, 2026 20:48
@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented May 13, 2026

Split the change per the c-test guide: 06d760e is the test commit (should_panic = "missing configuration field" capturing today's behaviour) and c2920ac drops should_panic and adds the per-segment case conversion. Force-pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants