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

From: "David J. Biesack" <[email-masked]>
Date: Fri, 14 Dec 2012 11:45:47 -0500

"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.

-- 
David J. Biesack | Principal API Architect, SAS | @davidbiesack | 919-531-7771 | www.sas.com

---

From: Mark Nottingham <[email-masked]>
Date: Mon, 17 Dec 2012 14:40:14 +1100

> ... the target location MUST reference ...

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/