Recipe to migrate properties configuration to yaml configuration (and vice versa)
What problem are you trying to solve?
Migration of an existing application that uses properties for Spring configuration to use of YAML for Spring configuration.
What precondition(s) should be checked before applying this recipe?
Existence of application*.properties files.
Describe the situation before applying the recipe
src/main/resources/config/application.properties
server.port=${PORT:8080}
logging.level.org.atmosphere = warn
spring.mustache.check-template-location = false
Describe the situation after applying the recipe
src/main/resources/config/application.yml
server:
port: ${PORT:8080}
logging:
level:
org.atmosphere: warn
spring:
mustache:
check-template-location: false
Have you considered any alternatives or workarounds?
Any additional context
Are you interested in contributing this recipe to OpenRewrite?
@timtebeek I have the start of a recipe properties->yaml and some infrastructure to support conversion either way.
I am reluctant to contribute it back (especially in this library).
https://github.com/tkvangorder/rewrite-sandbox/blob/main/src/main/java/org/openrewrite/contrib/convert/ConvertPropertiesToYaml.java
If you want to take the time to copy the code over, go for it.
Much appreciated, thanks! I'm out for the next two weeks, but could be interesting to take on after. Or anyone else that wants to step up in the mean time.