syntax="proto3";
import "google/protobuf/descriptor.proto"
extend google.protobuf.FieldOptions{
bool presence=50001;
}
message Mymessage
{
int32 foo=1[(presence)=true];
string bar=2;
}
I wrote following code and encoded:
Mymessage l_message;
l_message.set_foo(1);
l_message.set_bar("hello");
When I encoded it using l_message.SerializeToString(), the encoded payload doesn't have field options. Am I missing something? Please help.
What will be payload with custom field options encoded?