-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
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
Protobuf wrapper class serialized as nil #103
Comments
Hi @travisofthenorth - fields in Protobuf are always optional - meaning that any unspecified value will always be For instance, take a message Product {
uint64 id = 1;
string name = 2;
string description = 3;
} Lets say I wanted to update Google provides wrapper types, such as message Product {
uint64 id = 1;
google.protobuf.StringValue name = 2;
google.protobuf.StringValue description = 3;
} Now, we can pass either the name or description optionally, and in our code check for So, in other words - this behavior is expected and intentional. Thanks! |
@splittingred I'm explicitly passing in |
In any case, another one of my clients doesn't seem to have this problem, so it must be something silly like a gem version in the particular client I'm looking at. Thanks for taking a look, and apologies for the false alarm! |
If anyone encounters this error again, this was a bug in |
@travisofthenorth Oh! Interesting, I misunderstood your question then (didn't realize you were asking about the wrapper value vs the main message). Thanks for linking the protobuf fix. Appreciate it! |
Please describe the issue
Apologies in advance if this has nothing to do with
gruf
. I have a pretty straight-forward server/client setup and I'm serializing proto3 objects in the response. I'm seeing a strange issue where an int wrapper object with a value of 0, i.e.<Google::Protobuf::Int32Value: value: 0>
, comes over the wire to the client asnil
.How to Reproduce
Serialize a proto object with a property as described in the issue.
What should happen?
The response on the client side should contain
<Google::Protobuf::Int32Value: value: 0>
for the particular attribute instead ofnil
Anything else we should know?
Server:
The text was updated successfully, but these errors were encountered: