23

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];
}
  • How we can deprecate the whole message?
mkUltra
  • 2,828
  • 1
  • 22
  • 47

1 Answers1

45

You can set it as a top level option in the message:

message Foo {
   option deprecated = true;
   string old_field = 1;
}
Carl Mastrangelo
  • 5,970
  • 1
  • 28
  • 37