serde-rs / json

Strongly typed JSON library for Rust
Apache License 2.0
4.7k stars 536 forks source link

Discrepancy between serde_json::from_{reader,str} #1140

Open rmanoka opened 1 month ago

rmanoka commented 1 month ago

Thanks for the brilliant crate!

I've a suprising bug, where a call to serde_json::from_str parses correctly, but a similar call to serde_json:from_reader fails. The type that triggers the error is an untagged enum: ModelWrapper .

Here's a mwip: https://github.com/rmanoka/serde-json-tokenizer-deserialize-bug . The Deserialize impl on the type is via the derive-macros, so my guess is this may be a bug in serde_json?