`String` successfully parses bytes buffer
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
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),
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.