serde-rs / serde-rs/json

Uuid Serialization & Deserialization Error : expected ident at line 1 column 2

Open
#1,024 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.6k
Forks
670
PR merge metrics
No merged PRs in 30d

Description

I have a HashMap<String, String> That is storing data as such:

{'uuid': 'f4a9a11b-6e71-443d-9289-71a26fe6a018'}

When I use:

let data = self.session_data.get("uuid");
if data.is_none()
{
	return 0;
}
let test_uuid: Uuid = serde_json::from_str(data.unwrap().as_str())?;

I get the error:

expected ident at line 1 column 2

And I have no earthly idea why.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the serde_json::from_str call in the issue and inspect the exact string stored in the HashMap. Reproduce the reported error with the shown UUID value and determine what input format the deserializer receives. Done means the cause is explained and the issue has a verified, documented resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, rust
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.