If the target location does not exist the current implementation does nothing (which is good) but does not fail (which is bad).
local jsonpatch = require('jsonpatch')
local o = { key = "value" }
local operations = {
{ op = "remove", path = "/otherkey", value = "othervalue" },
}
print("object before")
for k,v in pairs(o) do print(k, v) end
print("err:", jsonpatch.apply(o, operations))
print("object after")
for k,v in pairs(o) do print(k, v) end
object before
key value
err: nil
object after
key value
Hi,
according to https://datatracker.ietf.org/doc/html/rfc6902/#section-4.2
"The target location MUST exist for the operation to be successful"
If the target location does not exist the current implementation does nothing (which is good) but does not fail (which is bad).
result of execution