Skip to content

Fix optimizing list insertion/deletion diffs #83

Open
@aeckert

Description

@aeckert

python-json-patch/tests.py

Lines 329 to 338 in 7b664c4

# TODO: this test is currently disabled, as the optimized patch is
# not ideal
def _test_should_just_add_new_item_not_rebuild_all_list(self):
src = {'foo': [1, 2, 3]}
dst = {'foo': [3, 1, 2, 3]}
patch = list(jsonpatch.make_patch(src, dst))
self.assertEqual(len(patch), 1)
self.assertEqual(patch[0]['op'], 'add')
res = jsonpatch.apply_patch(src, patch)
self.assertEqual(res, dst)

Is there ongoing work to fix this issue? This lib is much nicer than alternatives, but the sub-optimal diffing makes it unusable for my use case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions