Skip to content

Conversation

@der-eismann
Copy link

@der-eismann der-eismann commented Dec 1, 2025

What's changed?

What's your motivation?

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Dec 1, 2025
@der-eismann der-eismann force-pushed the add-spring-boot-4-test branch 2 times, most recently from f4c55df to d0dd5a8 Compare December 1, 2025 13:30
@timtebeek
Copy link
Member

Copying the failure here

diff --git a/project/src/main/resources/file.yaml b/project/src/main/resources/file.yaml
index c4f3ac8..87d3246 100644
--- a/project/src/main/resources/file.yaml
+++ b/project/src/main/resources/file.yaml
@@ -1,11 +1,10 @@ 
+
 server:
   port: 1234
 
 spring:
   datasource:
     url: jdbc:postgresql://localhost/test
-  servlet:
-    encoding:
-      charset: UTF-8
-      enabled: true
-      force: true
\ No newline at end of file
+spring.servlet.encoding.charset: UTF-8
+spring.servlet.encoding.enabled: true
+spring.servlet.encoding.force: true
\ No newline at end of file

@timtebeek
Copy link
Member

Since the recipe we use here leverages MergeYaml underneath the proper fix is probably in openrewrite/rewrite.

@timtebeek timtebeek added bug Something isn't working recipe Recipe requested labels Dec 15, 2025
@der-eismann
Copy link
Author

Since the recipe we use here leverages MergeYaml underneath the proper fix is probably in openrewrite/rewrite.

Thanks for the assessment! I'll see if I can create a testcase for MergeYaml then. YAML parsing and editing seems to be no easy task 🙂

@der-eismann
Copy link
Author

Hey @timtebeek, after looking at the YAML ChangePropertyKey recipe it explicitly says:

Expects dot notation for nested YAML mappings, similar to how Spring Boot interprets application.yml files.

And example 4 even shows the behavior described here, so maybe this is intended? Then I guess the only solution would be to get openrewrite/rewrite#6358 working.

@timtebeek
Copy link
Member

Ah yes then getting unfolding to work is your best way forward; any reason you're sticking to four spaces?

@der-eismann
Copy link
Author

No specific reason, I would change it to 2 spaces, unfortunately org.openrewrite.yaml.format.Indents can't change it, so we'd need to get another tool to change this, or do you have another suggestion?

@timtebeek
Copy link
Member

Thanks for the clarification; then let's instead focus on fixing this upstream, and close this effort since there's no associated fix here.

@timtebeek timtebeek closed this Jan 7, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working recipe Recipe requested

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants