Skip to content
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

feat: making enum evolution safer #291

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mnahkies
Copy link
Owner

It's useful to specify enum on fields in terms of documentation and nudging users to handle the full set of values correctly. However it does come with a pretty significant downside when thinking about clients where you may not have full control of the release cycle (eg: native mobile apps where you're at the mercy of the users as to when they update).

Currently the enum schema validation is very strict and will throw an error on unrecognized values, which then makes it difficult to safely extend the schema to include new values.

This change aims to find a middle-ground where we still get the benefits of enum for our client SDK's, but we also force consumers to anticipate new values being added and handle this case.

It will likely be configurable behind a flag, given that there may be situations where the current stricter behavior is desirable. Server enum handling will remain as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant