3Hren/msgpack-rust

Error "invalid type: byte array, expected a sequence" when it works with serde_json

mimoo opened this issue · 3 comments

mimoo commented

I'm getting the following error on something that should work (and works with serde_json).

thread 'main' panicked at 'called Result::unwrap() on an Err value: Syntax("invalid type: byte array, expected a sequence")

I posted a minimal repro here: jonasbb/serde_with#372 (comment)

mimoo commented

it works with bincode also:

    // bincode
    let encoded: Vec<u8> = bincode::serialize(&a).unwrap();
    println!("bincode encoded: {:?}", encoded);
    let decoded: A = bincode::deserialize(&encoded[..]).unwrap();
    println!("bincode decoded: {:?}", decoded);
    println!();

Given this comment I'm not sure if there's anything this crate needs to change?

mimoo commented

Looks like it! Sorry about that ^^