summaryrefslogtreecommitdiff
path: root/jsonpatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'jsonpatch.py')
-rw-r--r--jsonpatch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index d7c1988..dc54efc 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -225,6 +225,13 @@ class JsonPatch(object):
'copy': CopyOperation,
}
+ # Verify that the structure of the patch document
+ # is correct by retrieving each patch element.
+ # Much of the validation is done in the initializer
+ # though some is delayed until the patch is applied.
+ for op in self.patch:
+ self._get_operation(op)
+
def __str__(self):
"""str(self) -> self.to_string()"""
return self.to_string()