Skip to content

internal/encoding/yaml: support alias to scalars in map key (fixes #3821) #3822

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

Closed
wants to merge 1 commit into from

Conversation

OmriSteiner
Copy link
Contributor

@OmriSteiner OmriSteiner commented Mar 16, 2025

This makes the decoder follow aliases in YAML map keys. Before this commit the decoder would outright reject these keys as non-scalar keys. This commit adds support specifically for keys which are aliases to scalar values. YAML also permits non-scalar keys such as maps / sequences, but there's no equivalent for those in CUE, so we error out.

fixes #3821

This makes the decoder follow aliases in YAML map keys.
Before this commit the decoder would outright reject these keys as
non-scalar keys. This commit adds support specifically for keys which
are aliases to scalar values. YAML also permits non-scalar keys such as
maps / sequences, but there's no equivalent for those in CUE, so we
error out.

fixes cue-lang#3821

Signed-off-by: Omri Steiner <omri@steiners.co.il>
@OmriSteiner OmriSteiner requested a review from cueckoo as a code owner March 16, 2025 14:42
Copy link
Member

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll import into Gerrit shortly.

@mvdan mvdan self-assigned this Apr 9, 2025
@cueckoo cueckoo closed this in a6fff27 Apr 10, 2025
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.

YAML decoder does not handle aliases in map keys
2 participants