Skip to content

Commit 625555e

Browse files
authored
Merge pull request #113 from Alanscut/issue-102
fix #102: optimize error handling
2 parents 9e4d423 + 86f82be commit 625555e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jsonpatch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ def apply(self, obj):
473473
if part is None:
474474
return value
475475

476+
if part == "-":
477+
raise InvalidJsonPatch("'path' with '-' can't be applied to 'replace' operation")
478+
476479
if isinstance(subobj, MutableSequence):
477480
if part >= len(subobj) or part < 0:
478481
raise JsonPatchConflict("can't replace outside of list")

0 commit comments

Comments
 (0)