-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
I have a pre-existing msgpack schema that I tried to encode in rmp-serde like this:
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
#[serde(untagged)]
pub enum Value {
Numeric(f32),
String(String),
#[serde(with = "serde_bytes")]
Bytes(Vec<u8>),
Bool(bool),
}
However, if I use rmp-serde
to decode a buffer that happens to contain valid utf-8, like
{
"m": "set",
"path": "ui-state",
"value": {
"type": "Buffer",
"data": [
97
]
}
}
(base64 g6Fto3NldKRwYXRoqHVpLXN0YXRlpXZhbHVlxAFh
), I get a String
, but I actually wanted a Bytes
. It would be nice if there were some sort of strictness annotation that would make this behave as intended.
Metadata
Metadata
Assignees
Labels
No labels