File tree 2 files changed +87
-0
lines changed
.integration/artifacthub/json_merge_patch/0.1.1
2 files changed +87
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Introduction
2
+
3
+ ` json_merge_patch ` is a module for applying JSON merge patches (RFC 7368) for KCL values.
4
+
5
+ ## How to Use
6
+
7
+ + Add the dependency
8
+
9
+ ``` shell
10
+ kcl mod add json_merge_patch
11
+ ```
12
+
13
+ + Write the code
14
+
15
+ ``` python
16
+ import json_merge_patch as p
17
+
18
+ data1 = {
19
+ " firstName" : " John" ,
20
+ " lastName" : " Doe" ,
21
+ " age" : 30 ,
22
+ " address" : {
23
+ " streetAddress" : " 1234 Main St" ,
24
+ " city" : " New York" ,
25
+ " state" : " NY" ,
26
+ " postalCode" : " 10001"
27
+ },
28
+ " phoneNumbers" : [
29
+ {
30
+ " type" : " home" ,
31
+ " number" : " 212-555-1234"
32
+ },
33
+ {
34
+ " type" : " work" ,
35
+ " number" : " 646-555-5678"
36
+ }
37
+ ]
38
+ }
39
+ data2 = {
40
+ " firstName" : " John" ,
41
+ " lastName" : " Doe" ,
42
+ " age" : 30 ,
43
+ " address" : {
44
+ " streetAddress" : " 1234 Main St" ,
45
+ " city" : " New York" ,
46
+ " state" : " NY" ,
47
+ " postalCode" : None
48
+ },
49
+ " phoneNumbers" : [
50
+ {
51
+ " type" : " work" ,
52
+ " number" : " 646-555-5678"
53
+ }
54
+ ]
55
+ }
56
+ data_merge = p.merge(data1, data2)
57
+ ```
58
+
59
+ ## Resource
60
+
61
+ The code source and documents are [ here] ( https://github.com/kcl-lang/artifacthub/tree/main/json_merge_patch )
Original file line number Diff line number Diff line change
1
+ version : 0.1.1
2
+ name : json_merge_patch
3
+ displayName : json_merge_patch
4
+ createdAt : " 2024-05-02T20:09:45Z"
5
+ description : ' `json_merge_patch` is a module for applying JSON merge patches (RFC
6
+ 7368) for KCL values.'
7
+ links :
8
+ - name : KCL homepage
9
+ url : https://kcl-lang.io/
10
+ - name : KCL repo
11
+ url : https://github.com/kcl-lang/kcl
12
+ install : |
13
+ #### Add `json_merge_patch` with tag `0.1.1` as dependency
14
+ ```
15
+ kcl mod add json_merge_patch:0.1.1
16
+ ```
17
+
18
+ #### Pull `json_merge_patch` with tag `0.1.1` to local
19
+ ```
20
+ kcl mod pull json_merge_patch:0.1.1
21
+ ```
22
+ maintainers :
23
+ - name : kcl-lang.io
24
+
25
+ provider :
26
+ name : kcl-lang.io
You can’t perform that action at this time.
0 commit comments