4 ms·
Internally, it would be a b64 protobuf in a protobuf field. The json part is an automatic conversion.
by aleksiy123 2y ago
Internally, it would be a b64 protobuf in a protobuf field.
The json part is an automatic conversion.
- jeffbee 2y agoWhy would it be b64 encoded? There's nothing that prevents you from putting an encoded protobuf into a protobuf as `bytes` type. `bytes nestedMessage = 42;` Only delimited message formats like JSON or XML need to encapsulate messages before nesting.
- aleksiy123 2y agoBecause it is in a Json? Internally it probably is protobuf with bytes. But the external API is Json and so it needs to be converted at some point. https://stackoverflow.com/questions/49358526/protobuf-message-to-json-conversion-of-bytes-field-converts-string-to-base64 https://stackoverflow.com/questions/49358526/protobuf-messag...
- paulddraper 2y agoHuh? Internally, it is (maybe) a binary field of a protobuf. Then when translating to JSON, it was converted to a string via base64 encoding.