/
TestJsons.js
90 lines (78 loc) · 1.34 KB
/
TestJsons.js
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
79
80
81
82
83
84
85
86
87
88
89
90
// endpoint: https://localhost:{port}/api/{controller}/{id}
// method: PATCH
// header: Content-Type: application/json-patch+json
// body: Copy and paste one of the JSON patch document samples from the JSON project folder.
// add
[
{
"op": "replace",
"path": "/url",
"value": "www.xcode.me"
},
{
"op": "add",
"path": "/posts/0",
"value": {
"blogId": 1,
"title": "Third post",
"content": "Test 3"
}
}
]
// remove
[
{
"op": "remove",
"path": "/posts/0"
},
{
"op": "remove",
"path": "/posts/0/title"
}
]
// replace
[
{
"op": "replace",
"path": "/posts/0/content",
"value": "Test 4"
},
{
"op": "replace",
"path": "/posts/1",
"value": {
"title": "Title 5",
"content": "Test 5"
}
}
]
// move
[
{
"op": "move",
"from": "/posts/0/title",
"path": "/posts/1/title"
}
]
// copy
[
{
"op": "copy",
"from": "/posts/0/title",
"path": "/posts/1/content"
}
]
// test
[
{
"op": "test",
"path": "/url",
"value": "www.xcode.me"
},
{
"op": "test",
"path": "/posts/0/title",
"value": "Barry"
}
]