msgpack-rust
msgpack-rust copied to clipboard
Add rmpv::ext::to_value_named to keep struct keys
The current rmpv::ext::to_value
implementation turns Structs into Value::Array<Value::String>
which is not deserializable by other languages.
Technically I would call this a bug and opt to change the existing to_value
implementation, but to stay cautious of not breaking existing users' code I think it makes sense to introduce a new to_value_named
fn which instead turns Structs into Value::Map
and maintains their keys.
Fixes #190