Skip to content

Commit fa9d27a

Browse files
committed
chore: update artifacthub-pkg.yaml
1 parent 40be7b1 commit fa9d27a

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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

0 commit comments

Comments
 (0)