Open bozzaj opened 6 years ago
Same for replacing an object:
original
{
"x": "SomeVal",
"y": {
"a": 2,
"b": 3,
"c": 4
}
}
edited
{
"x": "SomeVal",
"y": {}
}
patch
[
{
"op": "remove",
"path": "/y/a"
},
{
"op": "remove",
"path": "/y/b"
},
{
"op": "remove",
"path": "/y/c"
}
]
expected
[
{
"op": "replace",
"path": "/y",
"value": {}
}
]
What would be the expected behavior? Somehow determinate which option would produce the smallest patch?
I noticed that json8-patch seems to be quite fast, with the exception of arrays. Consider the following:
I would expect this to return a patch of:
Instead, it returns:
Are they any plans for supporting objects within arrays without replacing the entire array?