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
From briefly looking over RFC6902, it seems like the right thing to do is actually not to make a distinction between OKey and AKey? It seems like whether a given path component is an "object index" or "array index" should instead depend on which type of JSON object you find during patching. (I.e. if you encounter an array, then try to parse the value as a numeric index, otherwise treat it as a string key for an object.) What do you think?
The text was updated successfully, but these errors were encountered:
Consider the following:
In this example, we're computing a diff between two
Map Int String
values. Note that these still produce string keys when encoded:When we compute the diff and encode it, we get the following:
This "path" seems to be ambiguous, because when we try to decode it:
The
pointerPath
is read in as anAKey
rather than the expectedOKey
. As a result, it fails to apply:From briefly looking over RFC6902, it seems like the right thing to do is actually not to make a distinction between
OKey
andAKey
? It seems like whether a given path component is an "object index" or "array index" should instead depend on which type of JSON object you find during patching. (I.e. if you encounter an array, then try to parse the value as a numeric index, otherwise treat it as a string key for an object.) What do you think?The text was updated successfully, but these errors were encountered: