ruby-protobuf / protobuf

A pure ruby implementation of Google's Protocol Buffers
https://github.com/ruby-protobuf
MIT License
463 stars 101 forks source link

Default value of a message conflicts with the proto spec #333

Open clarkdonald opened 8 years ago

clarkdonald commented 8 years ago

Hi,

In the ruby implementation, I've noticed that the default value of a message type is nil whereas in other languages the default value of a message type is the default instance. Other data types adhere to the proto spec - for example, the default value of a string field is an empty string rather than nil.

I've been burned by this conflicting behavior, and was wondering if this is the intended behavior for the ruby implementation?

abrandoned commented 8 years ago

Probably not intended behavior.... We will do some looking at the c and Java implementations and get the compat mode in line