ruby-protobuf / protobuf

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

Does this gem support protobuf v3? #384

Closed mainameiz closed 6 years ago

mainameiz commented 6 years ago

???

abrandoned commented 6 years ago

no, not yet

mainameiz commented 6 years ago

It seems to me that some parts of v.3 is supported (https://github.com/ruby-protobuf/protobuf/pull/382) I tried to generate ruby code using

$ protoc --plugin=protoc-gen-ruby-protobuf=/path/to/bin/protoc-gen-ruby --ruby-protobuf_out=lib

and then use generated classes to encode/decode a message and it works. I even compare binary data with google-protobuf and it's the same.

film42 commented 6 years ago

@mainameiz Interesting. I don't think any of use have tried using protobuf v3 with this gem. That's exciting to hear that it already seems to be working! If we can add tests to assert v3 coverage is :ok_hand: then I think we can start advertising v3 support. Thanks for the insight, @mainameiz !

abrandoned commented 6 years ago

@mainameiz @film42 that will be true for all messages that are binary compat between 2 and 3 .... 3 introduces maps and reserved keyword and a few other language constructs, the definitions are meant to be backward compat but not forward https://developers.google.com/protocol-buffers/docs/reference/proto3-spec

mainameiz commented 6 years ago

Thanks for help