Consider the following Proto file:
message Foo {
MyEnum my_enum = 1;
}
enum MyEnum {
MY_ENUM_UNSPECIFIED = 0;
MY_ENUM_BAR = 1;
MY_ENUM_QUX = 2;
}
I'm interested in receiving JSON-encoded Foo messages where the enum might have more values added to it later, without me having to update my Proto file and re-generate code. Both of these JSON blobs deserialize fine: {"myEnum": "MY_ENUM_UNSPECIFIED"} and {"myEnum": 1}. However, these two won't work: {"myEnum": "MY_ENUM_BUX"} and {"myEnum": 100}.
It would be great if some sort of mechanism could be added to tolerate unknown enum values.