Ron,
could you post and example and some explanation on how to (de)serialize
proto3 to JSON using
LIBPROTOBUF_EXPORT util::Status BinaryToJsonString(
TypeResolver* resolver,
const string& type_url,
const string& binary_input,
string* json_output,
const JsonOptions& options);
Thank you, I am working on it. Zach.
On Tuesday, April 5, 2016 at 11:41:48 AM UTC-7, Feng Xiao wrote:
>
> See examples here:
>
> https://github.com/google/protobuf/blob/master/src/google/protobuf/util/json_util_test.cc#L78
>
> On Mon, Apr 4, 2016 at 8:45 PM, Zachary Deretsky
{"intMap":["4":500,"0":100,"1":200,"2":300,"3":400]}
The above json is declared invalid by several json validators.
ZZ It is generated by the jtest.proto:
syntax = "proto3";
package jtest;
message Jmap {
map int_map = 2;
}
ZZZ
Thanks Ron, now I can generate json, but is is invalid for maps. I just
posted an example with my code.
Regards, Zach.
On Tuesday, November 24, 2015 at 11:42:22 AM UTC-8, Ron Ben-Yosef wrote:
>
> Hi,
>
> When using *BinaryToJsonString *or *BinaryToJsonStream*, I seem to
> encounter a problem
Is recursion handled, for example:
message Node {
string value = 1;
Node parent = 2;
message Child {
string key = 1;
Node child = 2;
}
repeated Child children = 3;
}
or
message Node {
string value = 1;
Are there examples of (de)serializing to JSON in C++?
What is TypeResolver and how to create it?
Thanks, Zach.
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
March 21, 2016 at 10:43:23 AM UTC-7, Zachary Deretsky wrote:
>>
>> Is recursion handled, for example:
>>
>> message Node {
>> string value = 1;
>> Node parent = 2;
>> message Child {
>> string key = 1;
>&
:
>
>
>
> On Tue, Apr 12, 2016 at 5:18 PM, Zachary Deretsky <zder...@gmail.com
> > wrote:
>
>> {"intMap":["4":500,"0":100,"1":200,"2":300,"3":400]}
>>
> Which version of protobuf are you using? Clear