-
Input Yaml data1.yml: spec:
versions:
- schema:
firstProperty: bar data2.yml: spec:
versions:
- schema:
secondProperty: foo Command
or docs
Actual behavior spec:
versions:
- schema:
secondProperty: foo Expected behavior spec:
versions:
- schema:
firstProperty: bar
secondProperty: foo Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There's two ways of doing it, the simple naive way, which merges arrays in the same position together: Or the more complex merge that will merge array entries based on a matching field: https://mikefarah.gitbook.io/yq/operators/multiply-merge#merge-arrays-of-objects-together-matching-on-a-key |
Beta Was this translation helpful? Give feedback.
There's two ways of doing it, the simple naive way, which merges arrays in the same position together:
https://mikefarah.gitbook.io/yq/operators/multiply-merge#merge-deeply-merging-arrays
Or the more complex merge that will merge array entries based on a matching field: https://mikefarah.gitbook.io/yq/operators/multiply-merge#merge-arrays-of-objects-together-matching-on-a-key