mkUltra
mkUltra

Reputation: 3068

How can I deprecate whole message in Protocol Buffers?

According to documentation:

deprecated (field option): If set to true, indicates that the field is deprecated and should not be used by new code.

Example of use:

message Foo {
 string old_field = 1 [deprecated = true];
}

Upvotes: 42

Views: 22440

Answers (1)

Carl Mastrangelo
Carl Mastrangelo

Reputation: 6658

You can set deprecated as a top level option on the message:

message Foo {
   option deprecated = true;
   string old_field = 1;
}

Upvotes: 66

Related Questions