json serialization and deserilization

25 views
Skip to first unread message

pavas goyal

unread,
Sep 18, 2022, 4:33:57 PM9/18/22
to Cap'n Proto
Hi,
I was looking for a serializer that encodes my "json" message in such in way that the encoded message just contains the values for json object. I have a well defined schema so I don't need the keys in every encoded message. I'm using capnp (python wrapper for capnproto) and it seems that the encoded message contains keys (making it quite longer than expected). Is there any workaround to remove the keys?

Kenton Varda

unread,
Sep 18, 2022, 4:39:11 PM9/18/22
to pavas goyal, Cap'n Proto
Hi Pavas,

I guess you mean you'd like for your message to be encoded to a JSON array, rather than an object? The array would be ordered to match the field order?

That's an interesting idea which you could implement with a custom JSON encoder, but the current provided JSON encoders do not have built-in support for this, sorry.

-Kenton

On Sun, Sep 18, 2022 at 3:33 PM pavas goyal <pava...@gmail.com> wrote:
Hi,
I was looking for a serializer that encodes my "json" message in such in way that the encoded message just contains the values for json object. I have a well defined schema so I don't need the keys in every encoded message. I'm using capnp (python wrapper for capnproto) and it seems that the encoded message contains keys (making it quite longer than expected). Is there any workaround to remove the keys?

--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/6baa4586-8a65-4095-96a5-1da45c3b6e37n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages