-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
json patch: adding to a subfield of a non-object now fails as expected #251
Conversation
Without this patch the library fails to apply the requested patch but reports success |
tests/json-patch-tests/tests.json
Outdated
{ "comment": "adding to subfield of a non-object should fail", | ||
"doc": {"foo": {"bar": 1}}, | ||
"patch": [{"op": "add", "path": "/foo/bar/baz", "value": "5"}], | ||
"error": "attempting to add to subfield of non-object" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but please add the test to cjson-utils-tests.json
instead. You can also make a pull request with the same test here, then I will pull the change into cJSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the test to cjson-utils-tests.json
and this is ready to merge.
Thanks a lot for spotting and fixing this error. |
You're welcome. I'm glad it was such a simple fix! I moved the test as you requested, but for what it's worth I'm a little confused why there are 2-3 different places with tests for json patch? |
That's because the
|
Ok, thanks for the explanation. |
This fixes a non-compliance with the json patch standard