Add support for extensible enum decoding #9
Merged
+61
−16
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.
Trying to decode an
enumwith a@HasExtensionMarkerannotation fails with the following error.A couple caveats apply to the proposed change:
null.Due to the second point above, if a protocol used an extensible optional enum, it would be impossible to tell whether an extended value was encoded or the optional enum was not encoded at all. Anyway, that is in my opinion better than not being able to decode such messages at all. And for protocols that do not use extensible enums there is no impact.
Another point to take care of is version change. If the project followed semver and used Maven Release Plugin (snapshot versions), I would change the version to 1.2.0-SNAPSHOT, but I don't know what the versioning policy is.