diff options
-rw-r--r-- | jsonpatch.py | 3 |
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") |