Add Protobuf read feature for unknown enum default fallback - #814
Open
Dongnyoung wants to merge 2 commits into
Open
Dongnyoung wants to merge 2 commits into
Dongnyoung wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #398
Adds
ProtobufReadFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUEto allow unknown enum numeric values to fall back to the Protobuf schema-level default enum value (the first declared enum constant).The feature is disabled by default, preserving existing behavior.
For standard enums, fallback preserves the existing
VALUE_NUMBER_INTtoken representation. For non-standard enums, it preservesVALUE_STRINGby using the first declared enum name.The fallback is handled at the Protobuf parser level and does not depend on databind's
EnumFeatureor@JsonEnumDefaultValue.Tests cover both standard and non-standard enums, including non-standard enums whose first declared numeric value is not
0.