-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure forward compatibility of experimental enums #467
Comments
Another option along the lines of option 2 above: https://github.com/bright/codified |
As a first step, this will be implemented with option 1. We'll see if there is a need for more complicated approaches later. |
My 2c: for #466 I would typically want to distinguish |
Ah! I had the solution 1 almost ready to ship this weekend. But I hesitated quite a bit because of the mentioned drawbacks. Ok since you show interest in distinguishing unknown values. I'll think of another approach. Either a variant of these This will also solve my naming dilemma for option 1's unknown value. The values |
As we have seen in #466, sometime the tip-of-tree protocol definitions don't contain the most recent values of some enums from experimental APIs.
To prevent deserialization crashes in these cases, we should somehow handle unknown values without crashing.
There are several options to go about it:
UNDEFINED
value for such enums, and use it when deserializing values that are not defined in the protocolUnknown(val value: String)
for the unknown ones.We could also mitigate the transition to stable by applying this solution to all enums, but this puts some hassle on consumers of stable APIs, which probably will never change.
Open question: what should be considered an experimental enum? A lot of enums are not marked as experimental themselves, but can be used in experimental types or APIs. We would probably have to check whether they are used exclusively in experimental types/APIs, and consider them as expeimental themselves in this case.
The text was updated successfully, but these errors were encountered: