-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Labels
Description
Given, for example, the following proto definitions:
message Address {
string street = 1;
}
message User {
Address address = 1;
}
the current behavior, when decoding an incoming User message, is to initialize the Address generated class even if the field is unset, filling it with empty ( zero ) values, which should not happen.
This is crucial for a variety of situations, for example using value wrappers, which are Protobuf Well-Known Types and represents the Google solutions to distinct a scalar field zero value from its default value. This is actually not possible with the current dart implementation, because the wrapper generated class is instantiated anyway and the inner value becomes a zero value.
Also, I think this is what was referred in #245.
darioielardi, cwe1ss, marvinluo1, tomerpeled, zs-dima and 8 more