Skip to content
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

Does not group Yaml properties correctly #4802

Open
diegosilval opened this issue Dec 19, 2024 · 0 comments
Open

Does not group Yaml properties correctly #4802

diegosilval opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@diegosilval
Copy link

What version of OpenRewrite are you using?

I am using

  • rewrite-maven-plugin v5.47.0
  • Maven v 3.9.9
  • rewrite-spring v5.25.0

How are you running OpenRewrite?

I am using the Maven plugin from command line.

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run  \
  -Drewrite.activeRecipes=com.sample.MyYamlRecipe \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:LATEST

And rewrite.yml

---
type: specs.openrewrite.org/v1beta/recipe
name: com.sample.MyYamlRecipe
recipeList:
  - org.openrewrite.yaml.ChangePropertyKey:
      oldPropertyKey: "app.rhino"
      newPropertyKey: "rhino"
  - org.openrewrite.yaml.ChangePropertyKey:
      oldPropertyKey: "app.security.header"
      newPropertyKey: "rhino.security.header"

What is the smallest, simplest way to reproduce the problem?

app:
  security:
    header:
      enabled: false
  rhino:
    config:
      props:
        - prop: 'name1'
          config[0]:
            prop1: 1
            prop2: 2
        -
          prop: 'name2'
          config[0]:
            prop1: 3
            prop2: 4

What did you expect to see?

rhino:
  security:
    header:
      enabled: false
  config:
    props:
      - prop: 'name1'
        config[0]:
          prop1: 1
          prop2: 2
      -
        prop: 'name2'
        config[0]:
          prop1: 3
          prop2: 4

What did you see instead?

rhino:
  config:
    props:
      - prop: 'name1'
        config[0]:
          prop1: 1
          prop2: 2
      -
                            prop: 'name2'
                            config[0]:
                              prop1: 3
                              prop2: 4
rhino.security.header:
  enabled: false
@diegosilval diegosilval added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant