summaryrefslogtreecommitdiff
path: root/jsonpatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'jsonpatch.py')
-rw-r--r--jsonpatch.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index 22e1156..7d5489a 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -479,6 +479,9 @@ class ReplaceOperation(PatchOperation):
if part is None:
return value
+ if part == "-":
+ raise InvalidJsonPatch("'path' with '-' can't be applied to 'replace' operation")
+
if isinstance(subobj, MutableSequence):
if part >= len(subobj) or part < 0:
raise JsonPatchConflict("can't replace outside of list")