googleapis / gax-ruby

Google API Extensions for Ruby
https://rubygems.org/gems/google-gax
BSD 3-Clause "New" or "Revised" License
20 stars 22 forks source link

Hash coercion: incorrect handling of map types #83

Closed geigerj closed 7 years ago

geigerj commented 7 years ago

Observed behavior

util.coerce will attempt to coerce the my_map field of {:my_map => {'a_string_key', 'a_string_val'}} to a proto because the value is a hash. The proto constructor then fails.

Expected

util.coerce should convert hashes to protos only if they are message fields, not map fields.