Fix #589: support non-scalar YAML mapping keys - #715
Open
arimu1 wants to merge 2 commits into
Open
Conversation
When SnakeYAML emits SequenceStart or MappingStart for an explicit complex
key (? [...] or ? {...}), consume the key structure and expose it as a
flow-style string property name so YAMLMapper/readTree can parse the document.
arimu1
force-pushed
the
fix/yaml-sequence-mapping-key-589
branch
from
August 15, 2026 03:00
7d2c2dc to
57bdcce
Compare
Handle Alias and Comment events inside complex key decoding, validate nesting depth against parser context, preserve deferred object anchor on first complex key entry, and expand streaming/readTree test coverage.
arimu1
force-pushed
the
fix/yaml-sequence-mapping-key-589
branch
from
August 15, 2026 03:05
33a812b to
d1f8bd4
Compare
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 #589
Summary
? [...]/? {...}) inYAMLParserwhen SnakeYAML emitsSequenceStartorMappingStartwhere a property name is expected[user, 123],{foo: bar}) soYAMLMapper/readTree()can parse documents that use sequence or mapping keys per the YAML specreadTreetests for sequence/mapping complex keys, implicit flow keys, nested/empty keys, quoted specials, and alias-in-keyTest plan
mvn -pl yaml -Dtest=StreamingYAMLParseTest#testComplexMappingKey*(9 tests, 0 failures; Java 17)StreamingYAMLParseTest#testComplexMappingKeySequence— reproduces issue example? [user, 123]: ...StreamingYAMLParseTest#testComplexMappingKeyMapping— mapping-as-key case withreadTree[]/{}, quoted specials, alias-in-key, object anchor deferral on first entry