Hi

I'm developing a golang server that will receive json in the following 
format. I can't work out how to write the description of this in a proto 
file and am hoping someone could help me! Thanks a lot in advance. 

{
    "key1": "asdfwefa",
    "key2": 13431,
    "key3": [
      [
        "asdfasdf",
        "cdcasdec",
        "dareceae"
      ],
      [
        "ggeqsase",
        "asdfdfgg",
        "asdreavf"
      ]
    ]
 }

The problem is the double array and the fact that the strings inside the 
array don't have named keys. I want to use something like following, but 
I'm not sure if there's a way to do this:

message MyObject {
    string key1 = 1;
    int32 key2 = 2;
    repeated Key3 key3 = 3;
}

message Key3 {
    repeated ...???...
}


Please note:
- I'm using proto3 syntax in my application in case that's important 
information.
- I can't modify the json format before it hits my golang server. However I 
could modify it when it arrives (somehow? perhaps marshal to a golang 
struct first, or modify the text string somehow - any easy solutions would 
be appreciated?) and then marshal it using the golang jsonpb package.


Thanks for any help

Mike


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

Reply via email to