[apps-discuss] Feedback on draft-ietf-appsawg-json-pointer-00

Mike Acar <macar@cloudmark.com> Thu, 01 March 2012 20:15 UTC

Return-Path: <macar@cloudmark.com>
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 E649421E8273 for <apps-discuss@ietfa.amsl.com>; Thu, 1 Mar 2012 12:15:10 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 MTRA+sYgys-8 for <apps-discuss@ietfa.amsl.com>; Thu, 1 Mar 2012 12:15:10 -0800 (PST)
Received: from ht1-outbound.cloudmark.com (ht1-outbound.cloudmark.com [72.5.239.25]) by ietfa.amsl.com (Postfix) with ESMTP id 2758221F85BD for <apps-discuss@ietf.org>; Thu, 1 Mar 2012 12:14:30 -0800 (PST)
Received: from [172.20.2.21] (172.20.2.21) by exch-htcas901.corp.cloudmark.com (172.22.10.73) with Microsoft SMTP Server (TLS) id 14.1.355.2; Thu, 1 Mar 2012 12:14:29 -0800
Message-ID: <4F4FD8A5.6010603@cloudmark.com>
Date: Thu, 01 Mar 2012 12:14:29 -0800
From: Mike Acar <macar@cloudmark.com>
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0) Gecko/20120129 Thunderbird/10.0
MIME-Version: 1.0
To: IETF Apps Discuss <apps-discuss@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [172.20.2.21]
Subject: [apps-discuss] 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, 01 Mar 2012 20:15:11 -0000

Hi,

I've been asked to review the JSON Pointer and Patch draft RFCs. I've 
had some discussion about them off-list, and have been advised to bring 
my issues to the list. And so, I am. :)

I've scanned the archived list discussion of the patch and pointer RFCs, 
so I don't think these issues have come up here already. Let me know if 
they have.

The first issue is comparing Unicode strings. Section 4 of 
http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-00 says

       If the currently referenced value is a JSON object, the new
       referenced value is the object member with the name identified by
       the reference token.

That is, if the reference token equals the name of some value within the 
object, move to that value. However, the tokens and values are Unicode 
strings; I'm not an expert in Unicode, but my impression is that testing 
Unicode strings for equality is not as simple as comparing sequences of 
bytes. For example, there are linguistic considerations: I believe 
German ö and oe are considered identical.

There's also the question of JSON documents with different encodings; 
UTF8 is the default, but UTF-16 and -32 with both endiannesses are also 
supported. Presumably this question will disappear in practice, since 
implementations will operate on deserialized data structures, not on 
JSON texts.

Could somebody with more expertise in this area comment? Perhaps this is 
all a solved problem, and the Pointer RFC simply needs to pick a 
normalization method and equality definition - or perhaps it's all so 
well-settled I'm seeing a problem where there is none.

Another issue is that the evaluation scheme implies some application 
semantics. Again, section 4:

    If a reference token is being evaluated against a concrete JSON
    document, the implementation MAY evaluate each token against a
    concrete value, and terminate evaluation with an error condition if a
    evaluation fails to resolve a concrete value.

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). That can still result in a user of Pointer having to 
implement it himself, if there are no implementations which offer him 
precisely what he needs.

Is it preferrable to explicitly say "You must make these decisions for 
your use case" instead of "Behavior in these cases is undefined"?

-- 
Mike Acar -                                 - macar at cloudmark dot com