-
Notifications
You must be signed in to change notification settings - Fork 53
feat: add ignore_unknown_enum_variants #147
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: add ignore_unknown_enum_variants #147
Conversation
|
@crepererum anything more needed for this eventually get merged? |
|
Sorry, I wasn't paying attention. Code looks good, could we extend CI to also test this feature here: Lines 123 to 145 in d067f2e
|
Done |
|
@crepererum can you approve workflow and see if this is good? |
f9e4bf5 to
2d7cf0e
Compare
|
@crepererum , rewrote commits to match sematic conventions (I think). So it'd need another run. |
|
Can you rebase against |
feat: add ignore_unknown_enum_variants feature Enabling this feature adjust deserialization to ignore unknown enum variants rather than Err out. This permits similar behavior to binary protobuf deserialization and greater backwards/forward compat. of the serialized messages.
2d7cf0e to
430704f
Compare
|
@crepererum , rebased... I think |
|
@crepererum ready to merge? |
|
I dunno why the CircleCI results aren't showing up here, but the CI pipeline succeeded: https://app.circleci.com/pipelines/github/influxdata/pbjson/329/workflows/7b275f7a-a07d-4c92-91a8-c7b8e6b0581d |
|
@crepererum thanks! Any chance to drop a new release as well? |
|
@xnorpx working on it |
|
@xnorpx done ✅ |
|
@crepererum thanks! Now we can remove our fork! |
This adds an option to ignore unknown enum variants on deserialization. This allows for better forward compatibility, as decoding JSON with newer enum values no longer fails, but instead defaults the enum values (typically set to UNSPECIFIED/UNKNOWN).
Add a test feature and tests specifically around this feature.
The related issue: #92