ietf
[Top] [All Lists]

Re: [apps-discuss] Last Call: <draft-ietf-appsawg-json-pointer-07.txt> (JSON Pointer) to Proposed Standard

2012-12-16 11:02:51
The author just needs to be aware of the current state of the object being
patched. Using conditional requests mechanisms can make it more reliable.


On Fri, Dec 14, 2012 at 9:38 AM, Markus Lanthaler
<markus(_dot_)lanthaler(_at_)gmx(_dot_)net>wrote:

On Friday, December 14, 2012 6:19 PM, James M Snell wrote:

On Fri, Dec 14, 2012 at 9:17 AM, Markus Lanthaler wrote:

Hmm.. I think that’s quite problematic. Especially considering
how JSON Pointer is used in JSON Patch.

How so? Doesn't appear to be a problem in practice.

Since it doesn't express the authors intent. For example, assume you have
a JSON Patch document like the following:

   [
     { "op": "test", "path": "/1", "value": 68 },
     { "op": "add", "path": "/2", "value": 105 }
   ]

What would you expect it to do? I think almost everyone would say that it
set the third element of an array to 105 iff the second value is 68. So you
might expect to get back an array on success but what you really get back
might be something like this:

{
  "some": "value",
  "1": 68,
  "some other": "value",
  "and": "finally",
  "2": 105
}

Maybe having something like ~2 to express that a number is to be treated
as an array index would solve it!?


--
Markus Lanthaler
@markuslanthaler


<Prev in Thread] Current Thread [Next in Thread>