Re: draft-ietf-appsawg-json-pointer-07 - array index for end ofarray

Mark Nottingham <> Tue, 18 December 2012 00:36 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2AAA021E8039 for <>; Mon, 17 Dec 2012 16:36:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -103.732
X-Spam-Status: No, score=-103.732 tagged_above=-999 required=5 tests=[AWL=-1.133, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 4dC7j4egqS2q for <>; Mon, 17 Dec 2012 16:36:35 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id E3A8D21E802E for <>; Mon, 17 Dec 2012 16:36:34 -0800 (PST)
Received: from [] (unknown []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id F15C2509B6; Mon, 17 Dec 2012 19:36:32 -0500 (EST)
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
Subject: Re: draft-ietf-appsawg-json-pointer-07 - array index for end ofarray
From: Mark Nottingham <>
In-Reply-To: <>
Date: Tue, 18 Dec 2012 11:36:28 +1100
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <>
To: Barry Leiba <>
X-Mailer: Apple Mail (2.1499)
Cc: "David J. Biesack" <>, IETF discussion list <>
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF-Discussion <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 18 Dec 2012 00:36:39 -0000

I disagree. Adding a capability for other indices down the road is NOT compatible for existing uses, so adding it will cause confusion ("are you using the old JSON Pointer or the new one?") and interop problems.

IIRC the discussion in the WG went much along these lines, and led to us explicitly choosing a single character, rather than a misleading "-1" construct. I'd be more comfortable with changing the character to something even further away, rather than making this construct even more confusing. 

The other way we could go would be to do full negative indexing; we don't have any use cases for that, and it increases complexity a bit, but at least it would be unsurprising.

On 18/12/2012, at 6:54 AM, Barry Leiba <> wrote:

>>> This was discussed in the Working Group, but it wasn't felt that the added
>>> complexity was worth it; there's a strong feeling that this spec should be as
>>> simple as possible.
>> Might I suggest, however, using -1 instead of "-" to refer to the last item in an
>> array, as this provides two benefits:
>> 1) Allows for adding the complexity down the road in a compatible way, should
>>   there be need
>> 2) Uniformity; i.e. always using integer values for referring to array elements.
> I have to say that this suggestion sounds very compelling to me, for
> both reasons.  I know there's a bunch of running code out there, but
> this (and perhaps teasing apart the "add" and "insert" concepts into
> separate verbs) seems worth the bother.
> Barry, as participant

Mark Nottingham