summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jsonpatch.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index ca22e34..e042ce2 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -473,6 +473,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")