msgpack-rust icon indicating copy to clipboard operation
msgpack-rust copied to clipboard

Add rmpv::ext::to_value_named to keep struct keys

Open julienvincent opened this issue 9 months ago • 0 comments

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

julienvincent avatar Sep 22 '23 01:09 julienvincent