package tutorial;
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
}
What does "1", "2", "3" mean ?
package tutorial;
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
}
What does "1", "2", "3" mean ?
Each field in the message definition has a unique numbered tag. These tags are used to identify your fields in the message binary format, and should not be changed once your message type is in use.
They're the field numbers - they're used in the wire representation to identify which field is associated with a value. This means that renaming a field isn't a breaking change (in terms of wire format) and the names themselves don't have to be serialized.