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

Mark Nottingham <mnot@mnot.net> Mon, 17 December 2012 03:40 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C2CA821F88A5 for <ietf@ietfa.amsl.com>; Sun, 16 Dec 2012 19:40:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -103.907
X-Spam-Level:
X-Spam-Status: No, score=-103.907 tagged_above=-999 required=5 tests=[AWL=-1.308, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y9jIkNOnxAr7 for <ietf@ietfa.amsl.com>; Sun, 16 Dec 2012 19:40:18 -0800 (PST)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) by ietfa.amsl.com (Postfix) with ESMTP id DA4FA21F88A4 for <ietf@ietf.org>; Sun, 16 Dec 2012 19:40:18 -0800 (PST)
Received: from [192.168.1.80] (unknown [118.209.33.170]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 8EEB3509B5; Sun, 16 Dec 2012 22:40:17 -0500 (EST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
Subject: Re: Last Call: <draft-ietf-appsawg-json-patch-08.txt> (JSON Patch) to Proposed Standard
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <p1txrolgzo.fsf@d72933.na.sas.com>
Date: Mon, 17 Dec 2012 14:40:14 +1100
Content-Transfer-Encoding: quoted-printable
Message-Id: <4CA116C1-3730-4602-AD07-890AABD9211F@mnot.net>
References: <p1txrolgzo.fsf@d72933.na.sas.com>
To: "David J. Biesack" <David.Biesack@sas.com>
X-Mailer: Apple Mail (2.1499)
Cc: ietf@ietf.org
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 17 Dec 2012 03:40:19 -0000

On 15/12/2012, at 3:45 AM, David J. Biesack <David.Biesack@sas.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/