Skip to content
Discussion options

You must be logged in to vote

This has been fixed on main and will be available in the next release. With objectIdentifyingProperty: name, MergeYaml correctly appends a new entry as a sibling in the sequence, even with compact YAML indentation (dash at the same level as the parent key).

Added regression tests to confirm both with and without explicit --- document separator:

@Issue("https://github.com/openrewrite/rewrite/discussions/7107")
@Test
void mergeSequenceWithCompactIndentationAndNestedSequence() {
    rewriteRun(
      spec -> spec
        .recipe(new MergeYaml(
          "$",
          //language=yaml
          """
            fruit:
            - name: blueberry
            """,
          false,
          "n…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@seachicken
Comment options

@timtebeek
Comment options

@seachicken
Comment options

@timtebeek
Comment options

@timtebeek
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by timtebeek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants