Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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];
}
  • How we can deprecate the whole message?
like image 736
mkUltra Avatar asked Oct 12 '18 14:10

mkUltra


Video Answer


1 Answers

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

message Foo {
   option deprecated = true;
   string old_field = 1;
}
like image 168
Carl Mastrangelo Avatar answered Sep 24 '22 14:09

Carl Mastrangelo