We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fda8192 commit 812fd63Copy full SHA for 812fd63
parser_test.go
@@ -143,6 +143,30 @@ var deleteTests = []DeleteTest{
143
path: []string{"b"},
144
data: `{"a":}`,
145
},
146
+ {
147
+ desc: "Delete object without inner array",
148
+ json: `{"a": {"b": 1}, "b": 2}`,
149
+ path: []string{"b"},
150
+ data: `{"a": {"b": 1}}`,
151
+ },
152
153
154
+ json: `{"a": [{"b": 1}], "b": 2}`,
155
156
+ data: `{"a": [{"b": 1}]}`,
157
158
159
160
+ json: `{"a": {"c": {"b": 3}, "b": 1}, "b": 2}`,
161
+ path: []string{"a", "b"},
162
+ data: `{"a": {"c": {"b": 3}}, "b": 2}`,
163
164
165
166
+ json: `{"a": [{"c": {"b": 3}, "b": 1}], "b": 2}`,
167
+ path: []string{"a", "[0]", "b"},
168
+ data: `{"a": [{"c": {"b": 3}}], "b": 2}`,
169
170
}
171
172
var setTests = []SetTest{
0 commit comments