Skip to content

Commit f42d357

Browse files
authored
Merge pull request #40 from mr-mixas/erroneous-path-parameter
tests for absent and invalid paths
2 parents 9ecd703 + 9cd84e0 commit f42d357

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,21 @@
383383
"patch": [{"op": "add", "path": "/1e0", "value": "bar"}],
384384
"error": "add op shouldn't add to array with bad number" },
385385

386+
{ "comment": "missing 'path' parameter",
387+
"doc": {},
388+
"patch": [ { "op": "add", "value": "bar" } ],
389+
"error": "missing 'path' parameter" },
390+
391+
{ "comment": "'path' parameter with null value",
392+
"doc": {},
393+
"patch": [ { "op": "add", "path": null, "value": "bar" } ],
394+
"error": "null is not valid value for 'path'" },
395+
396+
{ "comment": "invalid JSON Pointer token",
397+
"doc": {},
398+
"patch": [ { "op": "add", "path": "foo", "value": "bar" } ],
399+
"error": "JSON Pointer should start with a slash" },
400+
386401
{ "comment": "missing 'value' parameter to add",
387402
"doc": [ 1 ],
388403
"patch": [ { "op": "add", "path": "/-" } ],

0 commit comments

Comments
 (0)