We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ cat repo.rb require 'google/protobuf' require 'google/protobuf/wrappers_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "Person" do optional :name, :message, 1, "google.protobuf.StringValue" end end Person = Google::Protobuf::DescriptorPool.generated_pool.lookup("Person").msgclass puts "before decoding" puts hi = Person.new(:name => {:value => "hi"}) puts empty = Person.new(:name => {:value => ""}) puts not_set = Person.new() puts "after decoding" puts Person.decode(hi.to_proto) puts Person.decode(empty.to_proto) puts Person.decode(not_set.to_proto) // at google-protobuf 3.11.0 $ ruby repo.rb before decoding <Person: name: <Google::Protobuf::StringValue: value: "hi">> <Person: name: <Google::Protobuf::StringValue: value: "">> <Person: name: nil> after decoding <Person: name: <Google::Protobuf::StringValue: value: "hi">> <Person: name: nil> <Person: name: nil> // at google-protobuf 3.10.1 $ ruby repo.rb before decoding <Person: name: <Google::Protobuf::StringValue: value: "hi">> <Person: name: <Google::Protobuf::StringValue: value: "">> <Person: name: nil> after decoding <Person: name: <Google::Protobuf::StringValue: value: "hi">> <Person: name: <Google::Protobuf::StringValue: value: "">> <Person: name: nil> $ cat Gemfile.lock source "https://rubygems.org" gem "google-protobuf", "3.10.1"
I expect the decoded Person with an empty name to look like <Person: name: <Google::Protobuf::StringValue: value: "">>
<Person: name: <Google::Protobuf::StringValue: value: "">>
The text was updated successfully, but these errors were encountered:
Could you try this PR and verify that it fixes your problem?
#7195
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I expect the decoded Person with an empty name to look like
<Person: name: <Google::Protobuf::StringValue: value: "">>
The text was updated successfully, but these errors were encountered: