-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested array issue #261
Comments
I believe [
{
"op": "remove",
"path": "/names/3"
},
{
"op": "remove",
"path": "/names/2"
}
] and applying that patch to the source document does give {
"names": ["a", "b"]
} However, it looks like there is a bug in the function Daniel |
Hi - yes sorry. I transcribed the issue and didn't describe it fully. The remove operations mentioned above are being generated by jsoncons in that order when we apply a patch that removes 2 elements. |
The issue with |
Thanks for the quick fix - when is the next release ? |
We'll put this into patch release 0.154.2, should be out today or tomorrow. |
Go with latest 0.154.3, not .2 |
Describe the bug
Enumerate the steps to reproduce the bug
Include a small, self-contained example if possible
Given a json document with a nested array value 'names', e.g.
{ "names" : [ "a", "b", "c", "d" ] }
We've noticed that when the document is updated to remove entries in the nested array, for example when removing "c" and "d" above, we're sent a patchDocument that has the following operations:
OperationType:Remove path:"/names/2"
OperationType:Remove path:"/names/3"
This fails as /names/3 is no longer present once 2 is removed.
According to https://tools.ietf.org/html/rfc6902 it should instead read:
OperationType:Remove path:"/names/2"
OperationType:Remove path:"/names/2"
In https://tools.ietf.org/html/rfc6902 it states
Operations are applied sequentially in the order they
appear in the array. Each operation in the sequence is applied to
the target document; the resulting document becomes the target of the
next operation. Evaluation continues until all operations are
successfully applied or until an error condition is encountered.
What compiler, architecture, and operating system?
RedHat Linux 64 bit
What jsoncons library version?
0.153.3
The text was updated successfully, but these errors were encountered: