flipkart-incubator / zjsonpatch

This is an implementation of RFC 6902 JSON Patch written in Java
Apache License 2.0
523 stars 148 forks source link

Fix jsonPointer key check #176

Open wangxi761 opened 1 year ago

wangxi761 commented 1 year ago

in this case , JsonPointer.isArrayIndex may cause NumberFormatException which jsonpointer is /xxx/119962931388000000000000000007

{
    "119962931388000000000000000007": "851905683938304000"
}
wangxi761 commented 1 year ago

things aren't as simple as they seem,JsonPointer is a standalone container , It does not contain type information。

{
    "1": "851905683938304000"
}

jsonpointer is /1 , but we still can't say this is a array index or object key

to handle this, we need to add some additional information to it to determine whether this is the index of array or the key of the object?