The google protobuf allow me to write proto code like this:
syntax="proto2";
message hello
{
optional int32 id=1;
required string str=2[default="abc"];
optional int32 op=3 [default=15];
}
It compiles, no problem. I don't just quite understand that, for "optional" field, when there's no value specified, the decode stream return me the default value, it's OK. But what about the "required" field, it cann't be empty, so how its "default" is also valid? In what scenario?