Append to sequence
Recipe ID
org.openrewrite.yaml.AppendToSequenceArtifact
org.openrewrite:rewrite-yamlAppend item to YAML sequence.
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.yaml.AppendToSequence --recipe-option "sequencePath=$.universe.planets" --recipe-option "value=earth"If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite:rewrite-yaml:8.88.0Options
| Name | Type | Description |
|---|---|---|
sequencePathrequired | String | A JsonPath expression to locate a YAML sequence. e.g. $.universe.planets |
valuerequired | String | The new value to be appended to the sequence. e.g. earth |
existingSequenceValues | List | If specified, the item will only be appended if the existing sequence matches these values. e.g. existingValue1 |
matchExistingSequenceValuesInAnyOrder | Boolean | If specified in combination with the above parameter, the item will only be appended if the existing sequence has the specified values in any order. e.g. true |
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats