diff --git a/annet/annlib/jsontools.py b/annet/annlib/jsontools.py index c6596143..5849bdc6 100644 --- a/annet/annlib/jsontools.py +++ b/annet/annlib/jsontools.py @@ -28,7 +28,11 @@ def apply_json_fragment( try: new_value = pointer.get(new_fragment) except jsonpointer.JsonPointerException: - # no value found in new_fragment by the pointer, skip the ACL item + # no value found in new_fragment by the pointer, + # try to delete it from the new config + doc, part = pointer.to_last(full_new_config) + if isinstance(doc, dict) and isinstance(part, str): + doc.pop(part, None) continue _ensure_pointer_exists(full_new_config, pointer)