ietf
[Top] [All Lists]

Re: Last Call: <draft-ietf-appsawg-json-patch-08.txt> (JSON Patch) to Proposed Standard

2012-12-16 21:40:35

On 15/12/2012, at 3:45 AM, David J. Biesack 
<David(_dot_)Biesack(_at_)sas(_dot_)com> wrote:


"4.1 add" bullet 3 reads (when completing the introductory sentence)

... the target location MUST reference ...
o An element to add to an existing array.

I think this is incorrect; the target location is the array and the "value" 
is the "element to add to an existing array". I suggest:

... the target location MUST reference ...
o An existing array.


Given the JSON:

{
  "foo": [ "a", "b", "c" ]
}

then a reference to an existing array would be:

/foo

whereas a reference to an element of an existing array would be:

/foo/1

'add'ing to these would have VERY different effects; the former would replace 
the entire array; the latter would replace one member of it.

Both are legal, it's just that the former isn't getting captured in this 
definition; it's an object member, not an array member.

Cheers,

--
Mark Nottingham   http://www.mnot.net/




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