Computer scienceFundamentalsEssentialsStandards and formatsData formats

Syntax of Proto Files

Reserve tags of deleted fields

Report a typo

You have the following proto file:

package book.v1;

message Book {
  string title = 1;
  string subtitle = 2;
  repeated string authors = 3;
  uint32 yearPublished = 4;
  optional uint32 pages = 5;
  float price = 6;
  bool isNewRelease = 7;
}

The proto file is later updated to:

package book.v2;

message Book {
  string title = 1;
  repeated string authors = 3;
  optional uint32 pages = 5;
  float price = 6;
}

Reserve the appropriate tag(s) (in ascending order) to enforce compatibility.

Example:

reserved 1, 3
Enter a short text
___

Create a free account to access the full topic