Re: [Json] Extending JSON Patch (or JSON Pointer) to include indexing into a string

"Manger, James" <James.H.Manger@team.telstra.com> Tue, 08 October 2019 04:59 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 67E27120088 for <json@ietfa.amsl.com>; Mon, 7 Oct 2019 21:59:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=team.telstra.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 D_-tk05i6OmY for <json@ietfa.amsl.com>; Mon, 7 Oct 2019 21:59:56 -0700 (PDT)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F0F7512000F for <json@ietf.org>; Mon, 7 Oct 2019 21:59:52 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.67,269,1566828000"; d="scan'208";a="331383476"
X-Amp-Result: SKIPPED(no attachment in message)
Received: from unknown (HELO ipcbvi.tcif.telstra.com.au) ([10.97.217.204]) by ipobvi.tcif.telstra.com.au with ESMTP; 08 Oct 2019 15:59:37 +1100
Received: from wsapp5584.srv.dir.telstra.com ([10.75.131.20]) by ipcbvi.tcif.telstra.com.au with ESMTP; 08 Oct 2019 15:59:35 +1100
Received: from wsapp5873.srv.dir.telstra.com (10.75.11.109) by wsapp5584.srv.dir.telstra.com (10.75.131.20) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 8 Oct 2019 15:59:35 +1100
Received: from wsapp5584.srv.dir.telstra.com (10.75.131.20) by wsapp5873.srv.dir.telstra.com (10.75.11.109) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 8 Oct 2019 15:59:32 +1100
Received: from AUS01-SY3-obe.outbound.protection.outlook.com (10.172.229.125) by wsapp5584.srv.dir.telstra.com (10.75.131.20) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 8 Oct 2019 15:59:33 +1100
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdPEGjCReDwSSfbC8aemce5gRZvj0P1Ubo3d/+gzxesrs86I2xwp4aVKHLQ0IG7giMdycT9N66XzoJJP+nARp25MEZNm4/tE0drC308K2QWWo9IHRhVhZ+4+Abb3p1+1EtwHAdl0VwVYavCeHfD2AocG5ZfrmqWzHQoVKqcb+p946RM60ykT8CjHEosH4p0gElxhFooqIP7tjYjgKZoC45y2bPd21Y/QHCFwVSPsT/SH7/ZmIK2ti85fBkJKaybEggurM4YOTj582xw0NviBHnraMznGdAlB8Tqdvgb4LY5xUG3bL2VON1bahgSEuSFkS1qabbRxFJn5f/ry0/n+ug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JKzD/aIzoAYfWqN0vg+ZoI1TGKVeBRcOseSBXaOYhJ4=; b=Wl2GYAhE/bhez4ty8BSKoXp3/Dm9hh97BlHnFvNNOYg09smoiEUpH8iN6PiM+cUtXUQbxGnrd3+jCulRsSe2Y11faWpPfe2tMz1lvH8XZNprxuVxz2Fh+WLTiXVebR8gFilFkRjuW9IS0JIsxwrlLAgSs7JZSB6a3QzdXpdua3ve6vY3Zky8plOxb2+epEy+Utn7P3E2Li0OGGd8Xpp6yPmoHFceR1k1Y4z0DLUcjJ+fdjZdkTISQBGMNYDOXPDYHOum5fAKRF0Nviy8a342SqmJOrQdF6bSCOeglVE7V1Cb/3Ip8mgNATFH/SNzsK/CqnzATFDfdm5tIFvHHI3Zaw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=team.telstra.com; dmarc=pass action=none header.from=team.telstra.com; dkim=pass header.d=team.telstra.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=team.telstra.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JKzD/aIzoAYfWqN0vg+ZoI1TGKVeBRcOseSBXaOYhJ4=; b=OL+kOe+T2LOiG4PAwMAIGidhWHe/PsMd+H2BvmFgJEA4ciIv0uvjJtubsCh4iDznHhn88LHMkYcrMui1/MeP11wJ+ic0+lTaED7pD1Dacj3pAPhqRXh7fBQ0VeFH2Damtkj3Z5dHSG7q8JT6BcY8rVpZw2DeMLvn/jy+PahD0UE=
Received: from ME2PR01MB4177.ausprd01.prod.outlook.com (20.178.183.17) by ME2PR01MB2932.ausprd01.prod.outlook.com (52.134.209.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2327.24; Tue, 8 Oct 2019 04:35:29 +0000
Received: from ME2PR01MB4177.ausprd01.prod.outlook.com ([fe80::e100:6e71:80af:b904]) by ME2PR01MB4177.ausprd01.prod.outlook.com ([fe80::e100:6e71:80af:b904%4]) with mapi id 15.20.2327.023; Tue, 8 Oct 2019 04:35:29 +0000
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Mitar <mmitar@gmail.com>, "json@ietf.org" <json@ietf.org>
Thread-Topic: [Json] Extending JSON Patch (or JSON Pointer) to include indexing into a string
Thread-Index: AQHVenlmBaitXpHalkui722a3gmOu6dQJ1mg
Date: Tue, 08 Oct 2019 04:35:29 +0000
Message-ID: <ME2PR01MB417749D967E132FEFCA84F43E59A0@ME2PR01MB4177.ausprd01.prod.outlook.com>
References: <CAKLmikN0nNKL7Fyt4wn77_Nd1N9=UZE=jdcGKvb6v0z_LF0zUA@mail.gmail.com>
In-Reply-To: <CAKLmikN0nNKL7Fyt4wn77_Nd1N9=UZE=jdcGKvb6v0z_LF0zUA@mail.gmail.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
dlp-product: dlpe-windows
dlp-version: 11.1.100.23
dlp-reaction: no-action
authentication-results: spf=none (sender IP is ) smtp.mailfrom=James.H.Manger@team.telstra.com;
x-originating-ip: [203.35.185.254]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 8d88ec73-a97b-4d1d-f307-08d74ba8f2d1
x-ms-traffictypediagnostic: ME2PR01MB2932:
x-ms-exchange-purlcount: 1
x-microsoft-antispam-prvs: <ME2PR01MB2932C4EE4864F52A81ADE069E59A0@ME2PR01MB2932.ausprd01.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8882;
x-forefront-prvs: 01842C458A
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(376002)(136003)(39860400002)(366004)(346002)(396003)(189003)(199004)(102836004)(6506007)(110136005)(26005)(7696005)(66476007)(76176011)(76116006)(316002)(64756008)(66446008)(186003)(66556008)(66946007)(446003)(2501003)(33656002)(2906002)(74316002)(7736002)(305945005)(66066001)(11346002)(86362001)(99286004)(4744005)(5660300002)(25786009)(8936002)(476003)(81156014)(81166006)(6116002)(52536014)(229853002)(3846002)(14454004)(256004)(486006)(6436002)(71190400001)(55016002)(478600001)(8676002)(6306002)(71200400001)(6246003)(9686003); DIR:OUT; SFP:1102; SCL:1; SRVR:ME2PR01MB2932; H:ME2PR01MB4177.ausprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0;
received-spf: None (protection.outlook.com: team.telstra.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: BeS3fsE2R0N0caI1JxjSImme1/+l22GvUTUG7lRrGkJCmTdpBlKHBlG7xSP0o4/4dO3RzgQg92nWiws8ePtpIM3oeaxRbDgmgMeW5zS1vBw+K2KurjssYPqBnCivjohybZFCcmpFqBhrxEqY07UF+6SHSdHa7FNm/T1l1Akwko/QrM/zuxevQjBmWFOWJ886mDDjib4KZXrxiqfR8DaQBR7uTEEfWSr++bxQg/HVfeGa5I+DWmXPEpgh2RKT+d0yqJtkPoVTdD4HWt8uGn9p/J1rT352lNth60sJXN55dLzXkso+ZNukraL4tUwtfZGrX9ALcIa0VQFcV3PW14SyA5OSzgIWRKZb4epffm1xPcFdyQARwVSFT1It+GO9l0HShTb15YDZB5nvFvgOh6d8DKpog81nBnouebmC84EZ+15Y/ZIzuZV1OCs3s8BdXbd0JKs+47f1LN8A5ZRjs1zxPg==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 8d88ec73-a97b-4d1d-f307-08d74ba8f2d1
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2019 04:35:29.5649 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 49dfc6a3-5fb7-49f4-adea-c54e725bb854
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Hy4FM7xWHHmacIqBfRSrBXF32I7pOMkdePwGi1r+Ju6N6CMPFUYHCmff8ICQ3s50PIKRvXDUDwt2g+224v4AUo06Q0h16k+0TqzmMcZBYC8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: ME2PR01MB2932
X-OriginatorOrg: team.telstra.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/s157--JaBcKd2Pj_A84J3hR70nk>
Subject: Re: [Json] Extending JSON Patch (or JSON Pointer) to include indexing into a string
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 Oct 2019 04:59:59 -0000

> So what do people think about supporting a patch (probably by simply extending JSON Pointer)

Tacking "/0-3" or "/2-" on the end of a JSON Pointer is a bad idea as it looks like a legitimate JSON Pointer for an object member named "0-3" or "2-". A better approach would be a new "op" value and a new member to hold the range. For example:

  { "op":"string_replace", "path":"/value", "range":"0-3", "value":"no"}

Whether its best to provide a range & value, or old & new substrings, or a regex & replacement, or a line-oriented diff format, ... I'm not sure.

> Also, I have no experience with the IETF process on how would one go about introducing such a change to existing standards.

Perhaps write some code to convince yourself it works well; document it in an independent submission (https://www.rfc-editor.org/about/independent/) called, say, draft-mitar-json-string-patch; and see if any IETF group is interested.

--
James Manger