[apps-discuss] json-pointer #5 - semantics [was: Feedback on draft-ietf-appsawg-json-pointer-00]

Mark Nottingham <mnot@mnot.net> Thu, 31 May 2012 03:45 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2C8A511E8121 for <apps-discuss@ietfa.amsl.com>; Wed, 30 May 2012 20:45:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.599
X-Spam-Level:
X-Spam-Status: No, score=-102.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eBrj0yeQAR7y for <apps-discuss@ietfa.amsl.com>; Wed, 30 May 2012 20:45:43 -0700 (PDT)
Received: from mxout-07.mxes.net (mxout-07.mxes.net [216.86.168.182]) by ietfa.amsl.com (Postfix) with ESMTP id 2AC5911E80B7 for <apps-discuss@ietf.org>; Wed, 30 May 2012 20:45:43 -0700 (PDT)
Received: from [10.4.229.102] (unknown [69.20.3.135]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id BF29122E259 for <apps-discuss@ietf.org>; Wed, 30 May 2012 23:45:36 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Apple Message framework v1278)
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <9452079D1A51524AA5749AD23E003928077013@exch-mbx901.corp.cloudmark.com>
Date: Thu, 31 May 2012 13:45:32 +1000
Content-Transfer-Encoding: quoted-printable
Message-Id: <01173171-110F-4FBE-993A-E858B51E9068@mnot.net>
References: <4F4FD8A5.6010603@cloudmark.com> <1330638350.2531.11.camel@neutron> <4F514AF9.5010506@cloudmark.com> <9452079D1A51524AA5749AD23E003928077013@exch-mbx901.corp.cloudmark.com>
To: IETF Apps Discuss <apps-discuss@ietf.org>
X-Mailer: Apple Mail (2.1278)
Subject: [apps-discuss] json-pointer #5 - semantics [was: Feedback on draft-ietf-appsawg-json-pointer-00]
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 31 May 2012 03:45:44 -0000

On 03/03/2012, at 9:47 AM, Murray S. Kucherawy wrote:

>> -----Original Message-----
>> From: apps-discuss-bounces@ietf.org [mailto:apps-discuss-bounces@ietf.org] On Behalf Of Mike Acar
>> Sent: Friday, March 02, 2012 2:35 PM
>> To: apps-discuss@ietf.org
>> Subject: Re: [apps-discuss] Feedback on draft-ietf-appsawg-json-pointer-00
>> 
>>>> It's easy to imagine a case where a Pointer refers to a deep
>>>> hierarchy, e.g. /a/b/c/d, and the application semantics of following
>>>> it are to create automatically any non-existent intermediate objects.
>>>> 
>>>> My initial thought was that the Pointer RFC should explicitly say
>>>> that specs which use it (e.g. Patch) should define semantics for
>>>> ambiguous cases (non-unique or non-existent member names, array index
>>>> out of bounds, etc).
>> 
>> There is another case: What to do if a non-terminal reference token
>> names a value which is not a structured type; e.g.
>> 
>> { "a" : "b" }
>> 
>> How should you interpret "/a/c/d"? For Patch this should be an error,
>> but another application might promote the value of "a" from a string to
>> an object or array. If the Pointer RFC says this MAY be an error, it
>> disallows those semantics.
> 
> I don't agree that MAY disallows anything, but I do think the current expression is too mushy.
> 
> I think it's fine for the pointer document to say that the handling of such cases is application-specific, but it should actually say that, perhaps by using your two examples to illustrate how different applications using the pointer specification could behave.


This is <http://trac.tools.ietf.org/wg/appsawg/trac/ticket/5>.

It seems like we need to add language stating that failing to match a particular token can be considered an error, or can be used by a particular application to effect some other behaviour. Make sense?

That said, personally I think of JSON-Pointer as a way to find a node in a current document, *not* a way to manipulate that document, and I'm not sure overloading its semantics are a good thing.

Cheers,

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