No option to exclude keys from case conversion
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 265
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 4
Description
Currently, it is not possible to specify a list of keys that should be excluded from case conversion.
In my case, this makes it hard to build a config from an Environment and a File, where some identifiers in the file are kebab-case, while other parameters are snake_case.
For example, I want a kebab-case key and a snake_case configuration:
# TOML configuration
[foo.kebab-case-key]
snake_case_configuration = "bar"
# Environment configuration
FOO__KEBAB_CASE_KEY__SNAKE_CASE_CONFIGURATION=bar
While there is a method convert_case, it is applied to all collected keys. For this example, a possible solution would be something like:
Environment::default().convert_case_exclude_keys(Case::Kebab, ["snake_case_configuration"]);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading Environment::with_convert_case and its documentation to understand how case conversion is applied. Add support for excluding named keys while converting other keys, and verify that the kebab-case and snake_case configuration example can be represented as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100