python-json-patch
python-json-patch copied to clipboard
Raises KeyError when no "path" has been specified
The following patch
[
{
"op": "add"
}
]
when applied via
modified_config_dict = jsonpatch.apply_patch(config_dict, patch)
rasies a KeyError
because path
is not found. I was expecting it to raise a (subclass of) jsonpatch.JsonPatchException
.
Is this a bug or by design? If the latter is the case, then please reconsider this decision. I find it a lot easier to use a Python library when I know that all exceptions, that the API may raise, are a subclasses of a library-specific base exception.