dtolnay / dtolnay/path-to-error

Reporting the content of the key that doesn't match (untagged enum)

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
425
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Hello,
I'm parsing various data structures from JSONs an currently I'm getting an error that looks like this:

```
Error deserializing StructureX JSON: Error { path: Path { segments: [Map { key: "key1" }, Map { key: "key2" }, Map { key: "key3" }, Seq { index: 0 }, Map { key: "key4" }, Map { key: "key5" }, Map { key: "key6" }, Seq { index: 1 }, Map { key: "key7" }] }, original: Error("data did not match any variant of untagged enum EnumYFromStructureX", line: 0, column: 0) } for some specific case!
```

What I'd be interested in if I can get reported back the content of the key that did not match the enum - in any form (bytes/UTF-8 string/etc).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.