Skip to content

Patch representation unnecessary complex #78

Open
@markoh1

Description

@markoh1

With ver 1.20 Patch representation becomes unnecessary complex when inserting new element into list of lists. Using old implementation it was very simple to determine added element from "value" field.

Example:

import jsonpatch
a = [[1,'a']]
b = [[2,'b'], [1,'a']]
print jsonpatch.make_patch(a, b)

Ver 1.16 prints:

[{"path": "/0", "value": [2, "b"], "op": "add"}]

Ver 1.20 prints:

[{"path": "/0/0", "value": 2, "op": "replace"}, {"path": "/0/1", "value": "b", "op": "replace"}, {"path": "/1", "value": [1, "a"], "op": "add"}]

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