The Value type is expected to serialize/deserialize from data it represents. For the following test code:
fn test_deserialize_null_value() {
let val = crate::core::Value::Null;
let ret = crate::serde::to_vec(vec![], &val).unwrap();
eprintln!("{:02x?}", &ret);
}
Expected Output:
[f6]
which is the primitive value null, but
Actual Output:
[64, 4e, 75, 6c, 6c]
which is a 4-character UTF-8 text Null.
It looks like the generated implementation from the derive directives interprets Value as a externally tagged enum. Is it a mistake or a feature by design?
The
Value
type is expected to serialize/deserialize from data it represents. For the following test code:Expected Output:
which is the primitive value
null
, butActual Output:
which is a 4-character UTF-8 text
Null
.It looks like the generated implementation from the derive directives interprets
Value
as a externally tagged enum. Is it a mistake or a feature by design?