this post was submitted on 08 Sep 2023
0 points (50.0% liked)
Rust
5981 readers
51 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
An untagged enum doesn't need keys for the variants. It just tries to deserialize into each variant in the order defined.
That being said, you're right that the JSON is invalid.
Yeah, I wasn't trying to imply that it was a problem on the rust side or that they needed to name the keys that way, just that the JSON does need to have keys because that is how JSON works