zjsonpatch
zjsonpatch copied to clipboard
JsonDiff bug found
Expected Behavior
Source:
{
"store": {
"a": [
"v1",
"v2"
]
}
}
Target:
{
"store": {
"a": []
}
}
running JsonDiff.asJson(source, target)
should return:
[
{
"op": "remove",
"path": "/store/a/0",
"value": "v1"
},
{
"op": "remove",
"path": "/store/a/1",
"value": "v2"
}
]
Actual Behavior
But returns:
[
{
"op": "remove",
"path": "/store/a/0",
"value": "v1"
},
{
"op": "remove",
"path": "/store/a/0",
"value": "v2"
}
]
Steps to Reproduce the Problem
running JsonDiff.asJson(source, target)
Specifications
Maven Windows
Library Version: 0.4.16 Language (e.g. Java 1.8, Scala, etc): Java 17