title: How to model JSON array as protobuf definition
body: <p>I am writing a new service in golang using protobuf. I want to model the following Request JSON in the .proto file. </p>
  
  <pre><code>[
     {
      "var": ["myVariable1","myVariable2"], 
      "key1": 123123,
      "key2": 1122,
      "key3": "abcd-0101"
     },
    { 
      "var": ["myVariable1"], 
      "key1": 123124,
      "key2": 1123,
      "key3": "abcd-0102"
    },
  ] 
  </code></pre>
  
  <p>There are two problems currently : </p>
  
  <ul>
  <li>The keys in each array element are not known beforehand, hence I cannot create a message in .proto file and make it repeated. I need to keep it map</li>
  <li>I am unable to model a json which is just an array with no key. Everytime i do this, following error is shown : failed to decode request: json: cannot unmarshal array into Go value </li>
  </ul>
  
  <p>Following is my .proto file : </p>
  
  <pre><code>syntax = "proto3";
  
  package pb;
  
  import "google/protobuf/empty.proto";
  import "google/api/annotations.proto";
  
  service Transmitter {
    rpc GetVariables(GetVariablesRequest) returns (GetVariablesResponse) {
      option (google.api.http) = {
                  post: "/api/v1/{Service}/getVars"
                  body: "*"
              };
    };
  }
  
  
  message GetVariablesRequest {
    string Service = 1;
    repeated GetVarInput in = 2;
  }
  
  message GetVariablesResponse {
    string msg = 1;
  }
  
  message GetVarInput {
    map&lt;string,string&gt; Input = 2;
  }
  </code></pre>
  
  <p>I have tried with bytes instead of repeated GetVarInput, but it always comes empty. Also tried body:  "*" and body : "in"</p>
  
  <p>Please provide some pointers. </p>