You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
In a proto2 syntax message, an optional field set to the protobuf default value for that type can be distinguished from an unset field.
syntax = "proto2";
message Test {
optional string name = 1;
}
If name is not set, calls to getName() will return the empty string, and calls to hasName() will return false.
If name is explicitly set to the empty string, hasName() will return true.
When run through Converter.toDomain() to an appropriately annotated class, the result is that name will be null regardless of whether or not name was set on the protobuf or not.
The converter should respect the value indicated by hasField() for proto2 syntax messages, and shouldn't nullify explicitly set fields, and should return null only if 'hasField()` returns false. For proto3, returning the default value for any given type would be more consistent with Google's implementation than attempting to return null.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In a proto2 syntax message, an optional field set to the protobuf default value for that type can be distinguished from an unset field.
If name is not set, calls to
getName()
will return the empty string, and calls tohasName()
will return false.If name is explicitly set to the empty string,
hasName()
will return true.When run through
Converter.toDomain()
to an appropriately annotated class, the result is that name will be null regardless of whether or not name was set on the protobuf or not.The converter should respect the value indicated by
hasField()
for proto2 syntax messages, and shouldn't nullify explicitly set fields, and should return null only if 'hasField()` returns false. For proto3, returning the default value for any given type would be more consistent with Google's implementation than attempting to return null.The text was updated successfully, but these errors were encountered: