CPSC
CPSC

Reputation: 97

can .proto file fields be without values?

I received "missing field number" error. Is it possible to declare fields without value? since i do not have a default value to the fields.

syntax = "proto3";

package tutorial;

message Person {
  required string name;
  required string email;
}

Upvotes: 1

Views: 951

Answers (1)

Matteo
Matteo

Reputation: 39410

The field number is not refer to a default value but each field in the message definition has a unique number. These numbers are used to identify your fields in the message binary format, and should not be changed once your message type is in use.

More info here in the doc

Upvotes: 1

Related Questions