Skip to content

Merge only new fields without recursive merge #1934

Closed Answered by mikefarah
danicc097 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use "+" as a shallow merge:

yq 'load("examples/data1.yaml") + load("examples/data2.yaml")' -n
paths:
  /something:
    bla: 1
components:
  schemas:
    Pet: #gen
      only-this-field-should-appear: 1
    SomethingElse: #gen
      x-is-generated: true
      type: object
      properties:
        id:
          type: integer

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@danicc097
Comment options

Answer selected by danicc097
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants