You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this issue which is possible to reproduce in version 0.4.2
Given I have source json:
{ }
When I apply patch:
[
{
"op" : "replace",
"path" : "some-not-existing-path",
"value" : "some-value"
}
]
Then I get result:
{
"some-not-existing-path" : "some-value"
}
I would expect that implementation will throw an exception or will skip replacement of something which does not exist.
According to the RFC-6902 specification (https://tools.ietf.org/html/rfc6902#section-4.3):
The Replace operation functionally is identical to a "remove" operation for a value, followed immediately by an "add" operation at the same location with the replacement value.
For the Remove operation target location MUST exist for the operation to be successful.
The text was updated successfully, but these errors were encountered:
Agreed as per RFC "The target location MUST exist for the operation to be successful".
I will look into the library for this bug and will fix it as soon as possible if required.
On Wed, 7 Feb 2018 at 15:12 Gopi Vishwakarma ***@***.***> wrote:
Agreed as per RFC "The target location MUST exist for the operation to be
successful".
I will look into the library for this bug and will fix it as soon as
possible if required.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEC4CtvoASebah53oS-E_VehP-XrKR9ks5tSaFPgaJpZM4R8rqm>
.
Thanks for a great library!
I found this issue which is possible to reproduce in version 0.4.2
Given I have source json:
{ }
When I apply patch:
[
{
"op" : "replace",
"path" : "some-not-existing-path",
"value" : "some-value"
}
]
Then I get result:
{
"some-not-existing-path" : "some-value"
}
I would expect that implementation will throw an exception or will skip replacement of something which does not exist.
According to the RFC-6902 specification (https://tools.ietf.org/html/rfc6902#section-4.3):
The Replace operation functionally is identical to a "remove" operation for a value, followed immediately by an "add" operation at the same location with the replacement value.
For the Remove operation target location MUST exist for the operation to be successful.
The text was updated successfully, but these errors were encountered: