diff options
Diffstat (limited to 'jsonpatch.py')
| -rw-r--r-- | jsonpatch.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/jsonpatch.py b/jsonpatch.py index 838d66c..917fc33 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -484,6 +484,10 @@ class MoveOperation(PatchOperation): except (KeyError, IndexError) as ex: raise JsonPatchConflict(str(ex)) + # If source and target are equal, this is a no-op + if self.pointer == from_ptr: + return obj + if isinstance(subobj, MutableMapping) and \ self.pointer.contains(from_ptr): raise JsonPatchConflict('Cannot move values into its own children') |
