4 ms·
Their JSON have an key called payload which saves a String rather than an Object, is there any benefits to doing this? since they also escape the " in the Strin
by Zekio 10y ago
Their JSON have an key called payload which saves a String rather than an Object, is there any benefits to doing this? since they also escape the " in the String
- marksomnian 10y agoProbably that services aren't required to use JSON (since they use many different service languages, it's not unlikely that they use many different serialisation methods - JSON, protobuf, etc.)
- michalptaszek 10y agoExactly this - each publisher can encode their own payload, including protobufs, JSON, plain text or base64'd binaries. RMS itself is completely oblivious to the format of payload used in the message.
- tcard 10y agoSeparation of concerns: the code handling the envelope doesn't need to know about the format of the payload. The JSON in that payload will only be encoded (on the sender) and decoded (on the recipient) once.