Uh oh!
There was an error while loading. Please reload this page.
bug fix in move operation - #14
Conversation
fge
commented
Oct 31, 2014
Uh, sorry, I only just noticed this pull request... Does it also solve the other issue you mentioned? |
vishwakarma
commented
Nov 1, 2014
Hi, the pull request doesn't solve all cases, it solve cases covered by shared example, The whole MOVE operation needs to revisit. |
vishwakarma
commented
Dec 19, 2014
Hi, I have written java implementation names as zjsonpatch https://github.com/flipkart-incubator/zjsonpatch, it covers all cases which are currently missing in json-patch project. |
fge
commented
Dec 19, 2014
@vishwakarma which cases are missing? None are missing. JSON Patch works and so does JSON Merge Patch. And so does JSON Diff! It just doesn't optimize everything. But it works reliably. |
There was bug in factorization of diffs while finding pairs.
Example :
"first": { "b": [0, 1, 2] },
"second": { "b": [1, 2], "c": 0 ,"d":0}
patch obtained is :
{{ "op": "move", "from": "/b/0", "path": "/c"}, { "op": "move", "from": "/b/0", "path": "/d"}}
which is wrong, the correct patch generated should be
{ "op": "move", "from": "/b/0", "path": "/c"},{ "op": "add", "path": "/d", "value": 0}
There was bug in finding pair method, I have added necessary code fix for same.