I'm working on a ruby application that has google protocol buffers.
My proto file :
syntax = 'proto3'
message QuestionMessage {
int32 id = 1;
string question = 2;
int32 font_id = 3;
repeated int32 answers = 4 [packed=true];
}
When I run protoc it does generate the correct ruby file, but :packed => true is missing for the repeated int32 named answers. The generated code:
add_message "QuestionMessage" do
optional :id, :int32, 1
optional :question, :string, 2
optional :font_id, :int32, 3
repeated :answers, :int32, 4
end
I currently think there is a problem with my protoc not generating the correct things for the ruby file. But the weird thing is that I have libprotoc version 3.1.0(Build from source) and the gemfile of the project also has version 3.1.0 and everything works (encode and making objects) except for generating :packed => true. Can somebody help me? I looked allover but couldn't even find someone with the same problems. B.t.w. adding :packet => true doesn't work because google does not like that.
Edit:
I found a solution. I used this gem to generate my ruby protoc files. These files I can edit instead off the files generated by the google-protobuf gem which you can't. Then I added :packed => true through a script. Not the best solution, but it is a solution..