Ruby Hash of hash support in proto3 grpc

16 views
Skip to first unread message

Anjali Jaiswal

unread,
May 6, 2020, 9:50:36 AM5/6/20
to Protocol Buffers
I want to make a Ruby client. In my service_pb.rb file I have:

```
add_message 'request' do
  ...
  optional :test, :message, 12, 'google.protobuf.Struct'
end```

Now I am trying to pass the request params in my client.rb:


```
params = {xyz: "abc", test: { bar: "296" }}

stub = Message::Stub.new('localhost:9999', :this_channel_is_insecure)

msg = Request.new(params)
```

while running this I am getting: ArgumentError: Unknown field name 'bar' in initialization map entry.


I need to pass a Hash object in request params.

Reply all
Reply to author
Forward
0 new messages