Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openrewrite.yaml;
import lombok.EqualsAndHashCode;
import lombok.Value;
import org.intellij.lang.annotations.Language;
import org.jspecify.annotations.Nullable;
import org.openrewrite.*;
import org.openrewrite.internal.ListUtils;
import org.openrewrite.yaml.tree.Yaml;
@Value
@EqualsAndHashCode(callSuper = false)
public class MergeYaml extends Recipe {
@Option(displayName = "Key path",
description = "A [JsonPath](https://docs.openrewrite.org/reference/jsonpath-and-jsonpathmatcher-reference) expression used to find matching keys.",
example = "$.metadata")
String key;
@Option(displayName = "YAML snippet",
description = "The YAML snippet to insert. The snippet will be indented to match the style of its surroundings.",
example = "labels: \n\tlabel-one: \"value-one\"")
@Language("yml")
String yaml;
@Option(displayName = "Accept theirs",
description = "When the YAML snippet to insert conflicts with an existing key value pair and an existing key has a different value, prefer the original value.",
required = false)
@Nullable
Boolean acceptTheirs;
@Incubating(since = "7.30.0")
@Option(displayName = "Object identifying property",
description = "Name of a property which will be used to identify objects (mapping). This serves as the key to match on when merging entries of a sequence.",
required = false,
example = "name")
@Nullable
String objectIdentifyingProperty;
@Option(displayName = "File pattern",
description = "A glob expression representing a file path to search for (relative to the project root). Blank/null matches all.",
required = false,
example = ".github/workflows/*.yml")
@Nullable
String filePattern;
@Override
public Validated