Can a proto3 scalar field be changed to optional without breaking wire compatibility?

Viewed 47

Can I change a scalar field in proto3 to optional, e.g.

message UpdateAccountRequest {
  string name = 1;
  string country = 2;
}

to

message UpdateAccountRequest {
  optional string name = 1;
  optional string country = 2;
}

without breaking anything? That is, without affecting clients who are currently always setting those fields.

0 Answers
Related