It looks to me like your JSON syntax is right. Could you post the C++ code
you are using to parse the JSON file?

On Fri, Jun 2, 2017 at 1:16 AM, Qian Zhang <zhq527...@gmail.com> wrote:

> Hi,
>
> I have a C++ project in which there is a .proto file, and in that file,
> there is protobuf message which has a map field:
> "map<string, string> annotations = 5;"
>
> And the JSON file to be parsed with that .proto file has the following
> content:
> "annotations": {
>   "com.example.key1": "value1",
>   "com.example.key2": "value2"
> }
>
> The .proto file is in proto2 syntax (it has "syntax = "proto2";" at the
> beginning) and I am using protobuf-3.3.0, the compilation succeed, but I
> found the annotation map always has only one entry, and both the entry's
> key and value are "" which is obviously not correct.
>
> Any suggestions?
>
> --
> 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 to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to