-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch.yaml
78 lines (71 loc) · 1.84 KB
/
patch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
## List of Patches
## Patch Object Properties
## source: type string
#### required
#### [NEW|STDIN| path to a json file]
####
#### - NEW => same as '{}' as source file
#### - STDIN => read json from STDIN
#### - path to a json file
####
## destination: type string
#### required
#### [STDOUT| path to a json file]
####
#### - STDOUT => output patched json to STDOUT
#### - path to a json file => write (or override) patched JSON to a file (*)
#### (*) could be the same as 'source'
####
## json_patch: type string
#### required
#### A list JSON Patches (rfc6902) as inline YAML or JSON
#### to apply to the source and write as ouputs
#### reference:
#### - https://jsonpatch.com/
#### - https://github.com/evanphx/json-patch
####
## source_not_exist: type string
#### optional
#### ['fail'|'continue']
####
#### - fail => stop processing of all other patches
#### and return with error
#### - continue => skip current patch and continue processing
#### other patches
#### Default: 'fail'
####
## tags: type []string
#### optional
#### list of tags for patch, for --skip-tags options.
#### If at least one tag from --skip-tags input is in the
#### 'tags' list of a patch, the patch is skipped and processing
#### of remaining patches continue.
####
#### Example: --skip-tags 'tag1,tag2,tag3'
#### tags:
#### - tag2
####
#### Default: []
patches:
## Example json format
- source: NEW
destination: generated.json
tags:
- generated
json_patch: '[{"op":"add", "path": "/hello", "value":"world"}]'
## Example yaml format
- source: example/foo.json
destination: STDOUT
json_patch: |-
- op: replace
path: "/foo"
value: "baz"
## Example yaml format
- source: nonExistingFile.json
source_not_exist: continue
destination: STDOUT
json_patch: |-
- op: add
path: "/foo"
value: "baz"