google protobuf struct not supported in Ruby, Giving `initialization map entry` error while passing hash

75 views
Skip to first unread message

Anjali Jaiswal

unread,
May 8, 2020, 4:23:09 AM5/8/20
to grpc.io
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.

apo...@google.com

unread,
Jul 24, 2020, 4:58:07 PM7/24/20
to grpc.io
Sorry for the delay, does the answer in https://stackoverflow.com/questions/61597798/how-to-pass-hash-object-in-grpc-ruby-client work for you?
Reply all
Reply to author
Forward
0 new messages