A lot of code that uses this library needs to serialise its value types into JSON. It would be very nice to implement Into<JsonValue> and TryFrom<JsonValue> so that this can be performed with as little boilerplate as possible. However, it would require extra dependency on the json crate, which might be ok, but it complicates things slightly.
Other alternative is to do complete serialisation with something like serde, but that seems unnecessarily complex for now.
Actually, we should add a note about this into the developer recommendations as well: if you have a "data" class, always add JSON serialisation out of the box if possible.
A lot of code that uses this library needs to serialise its value types into JSON. It would be very nice to implement
Into<JsonValue>
andTryFrom<JsonValue>
so that this can be performed with as little boilerplate as possible. However, it would require extra dependency on thejson
crate, which might be ok, but it complicates things slightly.Other alternative is to do complete serialisation with something like
serde
, but that seems unnecessarily complex for now.