Repository navigation
Use Rune FQNs for enum choice dispatch - #338
Closed
plamen-neykov wants to merge 1 commit into
Closed
plamen-neykov wants to merge 1 commit into
plamen-neykov wants to merge 1 commit into
Conversation
Generate enum discriminator keys from the Rune fully qualified name, including enum aliases and options inside nested choices. Preserve primitive option keys and Python field names. Update the documentation and add regression coverage for metadata, aliases, and nested enum options.
4 tasks done
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.
Summary
Enum choice options currently use unqualified option names in
_CHOICE_DISPATCH. The runtime uses these keys when reading and writingchoice discriminators, so enum options serialize without their Rune FQN.
Generate fully qualified keys for enums, following the existing handling
of data types.
For example:
"Currency": "Currency""example.basicmetadata.Currency": "Currency"This also handles enum aliases and enum leaves within nested choices.
Metadata annotations do not change the discriminator. Primitive keys such
as
"string"and Python option field names remain unchanged.Compatibility
Models must be regenerated to receive the corrected dispatch tables.
Enum choice discriminators change from the option name to the enum's Rune
FQN. The runtime needs no further changes to consume these entries.
Validation
mvn -Dtest=PythonChoiceDispatchTest testAll 17 tests passed, including coverage for: