Re: [apps-discuss] #3: json-pointer escape characters

Mark Nottingham <mnot@mnot.net> Mon, 02 July 2012 00:01 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 B1CE711E811E for <apps-discuss@ietfa.amsl.com>; Sun, 1 Jul 2012 17:01:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.346
X-Spam-Level:
X-Spam-Status: No, score=-104.346 tagged_above=-999 required=5 tests=[AWL=-4.161, BAYES_40=-0.185, 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 kr9RrOWNyOPE for <apps-discuss@ietfa.amsl.com>; Sun, 1 Jul 2012 17:01:35 -0700 (PDT)
Received: from mxout-07.mxes.net (mxout-07.mxes.net [216.86.168.182]) by ietfa.amsl.com (Postfix) with ESMTP id 0609111E80AE for <apps-discuss@ietf.org>; Sun, 1 Jul 2012 17:01:34 -0700 (PDT)
Received: from mnot-mini.mnot.net (unknown [118.209.196.77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 9261E22E25B; Sun, 1 Jul 2012 20:01:29 -0400 (EDT)
Mime-Version: 1.0 (Apple Message framework v1278)
Content-Type: text/plain; charset="us-ascii"
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <1340984775.31848.2.camel@pbryan-wsl.internal.salesforce.com>
Date: Mon, 02 Jul 2012 10:01:26 +1000
Content-Transfer-Encoding: quoted-printable
Message-Id: <E249E3B0-5979-485C-A227-02FC797AECA1@mnot.net>
References: <A01EC297-4D41-433F-B242-6023FB9DACB6@mnot.net> <CC100EB1.2F27D%jhildebr@cisco.com> <255B9BB34FB7D647A506DC292726F6E114F730F2BA@WSMSG3153V.srv.dir.telstra.com> <1340897879.2393.9.camel@pbryan-wsl.internal.salesforce.com> <A0874F7F-D4CB-45D9-8BF1-F00AED4668F0@mnot.net> <CABkgnnWFvZH9EM6m+e-6pqwGbY702r7keDgLwjQJ+s-rtwg9aw@mail.gmail.com> <1340922969.2393.13.camel@pbryan-wsl.internal.salesforce.com> <255B9BB34FB7D647A506DC292726F6E114F730FACE@WSMSG3153V.srv.dir.telstra.com> <1340984775.31848.2.camel@pbryan-wsl.internal.salesforce.com>
To: "Paul C. Bryan" <pbryan@anode.ca>
X-Mailer: Apple Mail (2.1278)
Cc: IETF Apps Discuss <apps-discuss@ietf.org>, Joe Hildebrand <jhildebr@cisco.com>
Subject: Re: [apps-discuss] #3: json-pointer escape characters
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: Mon, 02 Jul 2012 00:01:35 -0000

I've started to go in this direction in <http://trac.tools.ietf.org/wg/appsawg/trac/changeset/85>; feedback appreciated.

I think we'll need a few examples to show that the ordering of decoding matters.

Also, anyone interesting in starting to collect test cases, as we've done for URI Templates <https://github.com/uri-templates/uritemplate-test>?

Cheers,


On 30/06/2012, at 1:46 AM, Paul C. Bryan wrote:

> I'll concede that ~0 is easier for humans and regular expression parsers to process than ~~, so I'll retract any suggestion that it should be so.
> 
> On Fri, 2012-06-29 at 10:19 +1000, Manger, James H wrote:
>> 
>> >> As a quoting character, ~ is a good choice.  I might offer that 0 and
>> >> 1 are strange choices for the next character, but I wont offer an
>> >> alternative except to note that double-escape is the more commonly
>> >> used method for escaping the escape character.
>> 
>> > True, ~~ would just as good to escape ~ instead of ~0...
>> 
>> No.
>> 
>> Using "~~" to escape "~" means a "~" in a pointer can be
>> either an escaper or an escapee -- and you have to count
>> a potentially indefinite number of preceding "~"'s to
>> determine the answer. That just makes parsing and matching
>> with a regex harder.
>> 
>> The names in the following 2 pointers end in "1" or "/".
>> Which is which?
>> 
>>  /~~~~~~~~~~~~~~~~~~~~1
>>  /~~~~~~~~~~~~~~~~~~~1
>> 
>> It is much more obvious if we use "~0" as the escape for "~".
>> 
>>  /~0~0~0~0~0~0~0~0~0~01
>>  /~0~0~0~0~0~0~0~0~0~1
>> 
>> --
>> James Manger
>> 
> 

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