sybila / biodivine-lib-param-bn

Rust library for working with parametrised Boolean networks.
MIT License
2 stars 3 forks source link

Provide `Into<JsonValue>` #20

Open daemontus opened 3 years ago

daemontus commented 3 years ago

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.

daemontus commented 3 years ago

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.