[art] Question regarding RFC 6901

Darren Doyle <valzho@outlook.com> Wed, 16 November 2016 06:29 UTC

Return-Path: <valzho@outlook.com>
X-Original-To: art@ietfa.amsl.com
Delivered-To: art@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 483831296A9 for <art@ietfa.amsl.com>; Tue, 15 Nov 2016 22:29:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.019
X-Spam-Level:
X-Spam-Status: No, score=-2.019 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=outlook.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04e1ja42aj_H for <art@ietfa.amsl.com>; Tue, 15 Nov 2016 22:29:42 -0800 (PST)
Received: from COL004-OMC3S10.hotmail.com (col004-omc3s10.hotmail.com [65.55.34.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 64AF21296A8 for <art@ietf.org>; Tue, 15 Nov 2016 22:29:42 -0800 (PST)
Received: from NAM02-CY1-obe.outbound.protection.outlook.com ([65.55.34.137]) by COL004-OMC3S10.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 15 Nov 2016 22:29:41 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=waOA+vldLIz0kFA8LjAzEEeajKI95mMwV0cFrIECFqw=; b=iRI2ZhGsSNjwjn5PHNPJmoPvpVC6TPxHT6soZctd2r51GDTDzn8oULIvGKvrqgo0WyzhiaGNuWVWGYBQNONsR6uhTxio2XZuLKUa6+6iKppZCCIqNBIFHzgsRNxxrdPVeJM8DMDt9R42mtC+3JtP7kDUoX+xdBBIlh0SOzhsmarK8zPaZrbVIibbZCUrdFTleyHidnTSmpS0PaQxlPgCIAulH6co1JGEFJUakkkdn/i+p44KrtSuwkXeNxfjJh/oPqOqAX+Tn68d0RKfFrzuYZBFvB4KrVCh7cr5WZWkbCYQ7QqQuYrTojWC74W3jnN7lBXMh8CCefeN6JommuJyaQ==
Received: from BL2NAM02FT045.eop-nam02.prod.protection.outlook.com (10.152.76.54) by BL2NAM02HT215.eop-nam02.prod.protection.outlook.com (10.152.76.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.5; Wed, 16 Nov 2016 06:29:41 +0000
Received: from DM5PR16MB1450.namprd16.prod.outlook.com (10.152.76.56) by BL2NAM02FT045.mail.protection.outlook.com (10.152.77.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.5 via Frontend Transport; Wed, 16 Nov 2016 06:29:40 +0000
Received: from DM5PR16MB1450.namprd16.prod.outlook.com ([10.173.211.8]) by DM5PR16MB1450.namprd16.prod.outlook.com ([10.173.211.8]) with mapi id 15.01.0721.013; Wed, 16 Nov 2016 06:29:40 +0000
From: Darren Doyle <valzho@outlook.com>
To: "art@ietf.org" <art@ietf.org>
Thread-Topic: Question regarding RFC 6901
Thread-Index: AQHSP9LPsZYSv3+PoEu/7pjuY2rUPA==
Date: Wed, 16 Nov 2016 06:29:40 +0000
Message-ID: <DM5PR16MB14509019BE97136178A70FEDDABE0@DM5PR16MB1450.namprd16.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=outlook.com;
x-incomingtopheadermarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:7031; Count:34
x-ms-exchange-messagesentrepresentingtype: 1
x-incomingheadercount: 34
x-eopattributedmessage: 0
x-microsoft-exchange-diagnostics: 1; BL2NAM02HT215; 5:gWF9woYT1pB+hrqMrVUqRUd8x5fY27N/+rcIWfylWZ0PJDT+tun+LAuQAVhBxfq7uT63iN5Lg+S3AqJZWjR/Lrae7evjuFzeyz2YUFDAAWNrZ1wflDZ9xARdUCO6FGUIezivOBMwBl5hI/rMohLkig==; 24:iTnWzswsF1g3KBy13hE9sxKKKNwZ9y3UhVH4Vg2oXsHnwqtPydwZPwLIgS2qEurII+6QuURyQHeR2FH3JW6pbtU52vCA6jsLEJC3nTmQs68=; 7:rpGGWypzQ5g4uR7iwRX3baObCE72zqdQqowyjdO2bUOAo8MfVpFBCHz3OzMI6O49M0qIEVO55OAnzjh+/A+PqG0SUF0FHiLccp124TiStdHRtsRFVvY2bM+OwAzFAcPH2tQ3aNglHSYlz8Qm26g2BDpT+WXzRpw1oFnAwkjQoZ4HHsVlGEaeMIfESxieiWKJGo66PFRjMa1CK4Fczg8au1gqDwxfZBCnTg5Fi6me4t2fV9g61xzRhk1Fh+JPOz4JGqaOnEGGIfW7I9Xx6zloecEatJLlkcIQQ5hJ6W5ECWK+eJbKCPcbGihZYtiyod16KNmQhhBTIznfTgt3JmMu9ZSR4in6RFHx6DVZqXv2pqs=
x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900003); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2NAM02HT215; H:DM5PR16MB1450.namprd16.prod.outlook.com; FPR:; SPF:None; LANG:en;
x-ms-office365-filtering-correlation-id: 68d2128f-20a7-487a-c804-08d40de9f135
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(1601124038)(1603103113)(1603101340)(1601125047); SRVR:BL2NAM02HT215;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015012)(82015046); SRVR:BL2NAM02HT215; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT215;
x-forefront-prvs: 01283822F8
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_DM5PR16MB14509019BE97136178A70FEDDABE0DM5PR16MB1450namp_"
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2016 06:29:40.3577 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT215
X-OriginalArrivalTime: 16 Nov 2016 06:29:41.0969 (UTC) FILETIME=[D06D9410:01D23FD2]
Archived-At: <https://mailarchive.ietf.org/arch/msg/art/dmI5_KAtrYP9434R76m8d1iBktI>
X-Mailman-Approved-At: Thu, 17 Nov 2016 13:00:51 -0800
Subject: [art] Question regarding RFC 6901
X-BeenThere: art@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Applications and Real-Time Area Discussion <art.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/art>, <mailto:art-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/art/>
List-Post: <mailto:art@ietf.org>
List-Help: <mailto:art-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/art>, <mailto:art-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 16 Nov 2016 06:30:41 -0000

I just wanted to submit something for consideration regarding the JSON Pointer specification (RFC 6901).

Currently the specification makes no consideration for JavaScript objects which contain numerical property keys—in all of the path examples of such.

Consider the following path: "/foo/1"

It is unclear whether this should point to this target: { "foo": [null, "target"] }
or to this target: { "foo": { "1": "target" } }

Both are acceptable JSON. I'm finding that parsing engines generally are able to find an existing path, but adding data to a non-existent path is where things start to break down.

PROPOSED SOLUTION:

Use the slash / to always indicate an object reference, and the colon : to always indicate an array reference. With this in mind:


  *   "/foo/1" evaluates to  { "foo": { "1": "target" } }
  *   "/foo:1" evaluates to { "foo": [ null, "target" ] }

If a colon is needed, it can simply be escaped as the other special characters with ~2 such that


  *   "/foo/1~2bar" evaluates to  { "foo": { "1:bar": "target" } }


Thank you for your consideration!
Darren Doyle