Skip to content

MergeYaml giving unexpected results where JSON path value of key includes wildcards #3310

@wabrit

Description

@wabrit

I am using

  • OpenRewrite v1.19.4
  • Maven plugin org.openrewrite.maven:rewrite-maven-plugin:4.46.0

I'm attempting to use the MergeYaml recipe in this scenario:

Old Yaml

list:
  services:
    foo:
      alpha: randomValue1
    bar:
      alpha: randomValue2

New Yaml

list:
  services:
    foo:
      alpha: randomValue1
      beta: fixedValue
    bar:
      alpha: randomValue2
      beta: fixedValue

I tried using MergeYaml with key set to $.list.services.* and yaml set to beta: fixedValue, but it gives me:

list:
  services:
    foo:
      alpha: randomValue1
    bar:
      alpha: randomValue2
    beta: fixedValue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions