Replies: 3 comments 6 replies
-
Find and replace is conceptually an activity applied to textual source. When using the Using find and replace in a declarative YAML recipe will work, but it's a very common mistake that users run into when they then try to then compose language aware recipes after the find and replace operation occurred. So often a mistake that it's documented explicitly that language specific operations should be applied first and then find and replace applied at the very end. You can see that documented here: https://docs.openrewrite.org/recipes/text/findandreplace |
Beta Was this translation helpful? Give feedback.
-
@dayagz Do you not know what mapping needs replacing in your YAML? If you can't use ChangePropertyValue you could also implement a custom recipe that replaces any scalar value matching a given substring or pattern. |
Beta Was this translation helpful? Give feedback.
-
Our organization would also love to see this feature: Presently, we've started creating a recipe to migrate from Micronaut 4 to Spring Boot 3.x. (Ideally we would use an existing one, but plenty of Googling suggests this doesn't exist at the moment...?) And one of the bigger pain points, is migrating Yaml-based config. Ideally we would like to be able to use wildcard-based replacements, when properties map 1:1 between the two. DB connection info is one place where wildcards might work. To be fair, we likely will need quite a few individual replacements, given the differences between the two frameworks. But for the specific cases where we can use a wildcard [for key name replacement], that would be tremendously helpful! Questions, thoughts, suggestions...? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
OpenRewrite YAML recipes currently do not support find and replace operations. The text-based find and replace modifies the structure, which prevents subsequent recipes from being applied. Could we consider adding a find and replace recipe?
Beta Was this translation helpful? Give feedback.
All reactions