My use-case requires capnp messages to (also) be serialized to json and deserialized from json. This PR adds support for this by converting binary data to a base64 encoded string, which is compatible with json.
The implementation is non-breaking, the previous behavior stays the same, but can be controlled via a msg.to_dict(encode_binary_as_base64=True).
I realize this might be a rare use-case but doesn't hurt to have it as a feature and at least in my case it's useful to have json as a fallback solution in the communication stack for debugging purposes.
My use-case requires capnp messages to (also) be serialized to json and deserialized from json. This PR adds support for this by converting binary data to a base64 encoded string, which is compatible with json.
The implementation is non-breaking, the previous behavior stays the same, but can be controlled via a
msg.to_dict(encode_binary_as_base64=True)
.I realize this might be a rare use-case but doesn't hurt to have it as a feature and at least in my case it's useful to have json as a fallback solution in the communication stack for debugging purposes.