Change YAML property

Apache 2.0

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

org.openrewrite.yaml.ChangePropertyValue

Required

The key to look for. Supports glob patterns.

The new value to be used for key specified by propertyKey.

Optional

Only change the property value if it matches the configured oldValue.

regexBoolean

Default false. If enabled, oldValue will be interpreted as a Regular Expression, to replace only all parts that match the regex. Capturing group can be used in newValue.

relaxedBindingBoolean

Whether to match the propertyKey using relaxed binding rules. Default is true. Set to false to use exact matching.

A glob expression representing a file path to search for (relative to the project root). Blank/null matches all.

mod run . --recipe=org.openrewrite.yaml.ChangePropertyValue \ -P propertyKey='management.metrics.binders.*.enabled' \ -P newValue=newValue

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.