go-patch icon indicating copy to clipboard operation
go-patch copied to clipboard

Appending many items to an array

Open drich10 opened this issue 9 years ago • 1 comments

It would be lovely if I could append multiple items in a single operation. It can become a bit unwieldily writing it many times.

- type: replace
  path: /releases/-
  value:
    name: extra-release-0
    version: 0
    url: file://extra-release-0

- type: replace
  path: /releases/-
  value:
    name: extra-release-1
    version: 1
    url: file://extra-release-1

- type: replace
  path: /releases/-
  value:
    name: extra-release-2
    version: 2
    url: file://extra-release-2

--->

?

Wish I had a good suggestion for what could be done here 😋

drich10 avatar Dec 09 '16 23:12 drich10

A proposal:

- type: append
  path: /releases/
  values:
    -  name: extra-release-0
       version: 0
       url: file://extra-release-0
    -  name: extra-release-1
       version: 1
       url: file://extra-release-1
    -  name: extra-release-2
       version: 2
       url: file://extra-release-2

jtarchie avatar Feb 09 '17 23:02 jtarchie