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
I'm using a protocol definition that has a message containing a map<string,string>.
When the map contains an empty value (e.g. "Foo" => ""), the C# protobuf implementation serializes field 1 (i.e. the "key") with a value of "Foo" and does not serialize a field 2 (i.e. the "value").
According to the protobuf documentation on default values, it appears this is completely legal and deserializers should treat the missing field as "default" (in this case, an empty string).
However, read_map_into explicitly checks for (_, None) and errors:
I'm using a protocol definition that has a message containing a
map<string,string>
.When the map contains an empty value (e.g.
"Foo" => ""
), the C# protobuf implementation serializes field 1 (i.e. the "key") with a value of"Foo"
and does not serialize a field 2 (i.e. the "value").According to the protobuf documentation on default values, it appears this is completely legal and deserializers should treat the missing field as "default" (in this case, an empty string).
However,
read_map_into
explicitly checks for(_, None)
and errors:rust-protobuf/protobuf/src/rt.rs
Line 980 in c8e7631
The result is an
IncompleteMap
error instead of the expected map containing an empty string value.The text was updated successfully, but these errors were encountered: