Use a HashMap for a config entry without changing the case
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 265
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 4
Description
I have a config that contains an entry watched_variables that I want to deserialize into the WatchedVariables structure defined below
{
"watched_variables": {
"PickObject": ["n_objects"],
},
}
#[derive(Clone, Debug, Default)]
pub struct WatchedVariables(pub HashMap<String, Vec<String>>);
I tried to use #derive(Deserialize) but the key gets converted to lower case.
How can I deserialize this without any modification of the key?
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 with the WatchedVariables structure and the attempted Deserialize derive described in the issue, then trace how the watched_variables entry is deserialized. Confirm why the PickObject key becomes lowercase and document or implement a supported approach that preserves the original key exactly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, rust
- Domain
- tooling
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100