I have a field of an enum type that I would like to deprecate. No clients use this field or its enum type. I want to reserve all of the values in this enum so that it cannot be reused.
message Example {
...
enum Foo {
BAR = 0;
BAZ = 1;
}
Foo foo = 42;
}
My first thought was to try reserving the values from 0 to max
as follows:
message Example {
...
enum Foo {
reserved "BAR", "BAZ";
reserved 0 to max;
}
reserved "foo";
reserved 42;
}
However, I get an error stating that Foo
must contain at least one value. Is there any way to deprecate an entire enum like this in order to make sure it isn't reused?