Yes, it is. Thank you.

But I'd rather like to define a repeated message struct and give a 
meaningful field name to it. Fields name key/value are really noisy. :(

On Saturday, February 25, 2017 at 1:11:14 AM UTC+1, Adam Cozzette wrote:
>
> I believe the way to do it is something like this:
>
>   option (ext) = {
>     query: {
>       key: "key",
>       value: "value",
>     }
>   };
>
> This works because internally maps are represented like a repeated field 
> of messages, each containing fields called "key" and "value".
>
> On Fri, Feb 24, 2017 at 2:15 PM, Googol Lee <i...@googol.im <javascript:>> 
> wrote:
>
>> I want to make a map option to rpc. I try the code below.
>>
>> message Ext {
>>   map<string, string> query = 1;
>> }
>>
>> extend google.protobuf.MethodOptions {
>>   Ext ext = 10000;
>> }
>>
>> service S {
>>   rpc method(In) returns (Out) {
>>     option (ext) = {
>>       query: {
>>         "key": "value",
>>       }
>>     };
>>   }
>> }
>> ```
>>
>> But when I run protoc, it replys 'Error while parsing option value for 
>> "ext": Expected identifier, got: "key"'.
>>
>> I tried many ways to set query map value, but all failed. Is there a way 
>> to do that? How?
>>
>> Thank you.
>>
>> -- 
>> 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+u...@googlegroups.com <javascript:>.
>> To post to this group, send email to prot...@googlegroups.com 
>> <javascript:>.
>> 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