udoprog/musli

musli-json field skip doesn't work correctly

l4l opened this issue · 1 comments

l4l commented

MRE:

#[derive(Debug, Encode, Decode)]
#[musli(default_field_name = "name")]
struct T {
    a: f64,
}

musli_json::from_slice::<T>(r#"{"x":"1","a":1.3}"#.as_bytes()).unwrap();

Works, if skipped field is not a string, e.g "x":1. Same if appended to the end.

This and #29 makes me want to extend the test suite to randomly inject whitespace and skipping of fields(for formats which support it. Cheers!