Re: [Json] [apps-discuss] merge-patch in APPSA and i-json in JSON

Paul Hoffman <paul.hoffman@vpnc.org> Tue, 08 July 2014 19:11 UTC

Return-Path: <paul.hoffman@vpnc.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A62B21A0400; Tue, 8 Jul 2014 12:11:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.347
X-Spam-Level:
X-Spam-Status: No, score=-1.347 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_MISMATCH_COM=0.553] autolearn=no
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 OlhOGvYX9dNm; Tue, 8 Jul 2014 12:11:38 -0700 (PDT)
Received: from hoffman.proper.com (IPv6.Hoffman.Proper.COM [IPv6:2605:8e00:100:41::81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 43DFF1A0255; Tue, 8 Jul 2014 12:11:38 -0700 (PDT)
Received: from [10.20.30.90] (50-1-51-60.dsl.dynamic.fusionbroadband.com [50.1.51.60]) (authenticated bits=0) by hoffman.proper.com (8.14.8/8.14.7) with ESMTP id s68JBZGu054638 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 8 Jul 2014 12:11:37 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
X-Authentication-Warning: hoffman.proper.com: Host 50-1-51-60.dsl.dynamic.fusionbroadband.com [50.1.51.60] claimed to be [10.20.30.90]
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <20140708190635.GD6016@mercury.ccil.org>
Date: Tue, 08 Jul 2014 12:11:34 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <319A4568-1D97-4D34-9C66-9ABF3727CDE6@vpnc.org>
References: <13c1732c5d504e84b80cd82e5e8f05ab@BL2PR02MB307.namprd02.prod.outlook.com> <DE7ECD34-F035-46CC-B0B0-571039A86F3F@vpnc.org> <20140708190635.GD6016@mercury.ccil.org>
To: John Cowan <cowan@mercury.ccil.org>
X-Mailer: Apple Mail (2.1878.6)
Archived-At: http://mailarchive.ietf.org/arch/msg/json/6c-RzZAN3QyyPUhnHP6-bF1GcrA
Cc: "apps-discuss@ietf.org" <apps-discuss@ietf.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] [apps-discuss] merge-patch in APPSA and i-json in JSON
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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 Jul 2014 19:11:39 -0000

On Jul 8, 2014, at 12:06 PM, John Cowan <cowan@mercury.ccil.org> wrote:

> Paul Hoffman scripsit:
> 
>>> - Is merge operation defined for target JSON that isn't i-json?
>> 
>> Yes. The merge operation is defined for all targets, regardless of
>> the targets' profile of JSON.
> 
> Actually, it isn't.  It is far from clear from
> draft-ietf-appsawg-json-merge-patch-04 what to do if a key appearing in
> the patch matches more than one key appearing in the target.  This has
> nothing to do with I-JSON as such, but is a deficiency in the merge-patch
> algorithm, the relevant part of which I reproduce here:
> 
>       for each Key/Value pair in Patch:
>         if Value is null:
>           if Key exists in Target:
>             remove the Key/Value pair from Target
>         else:
>           Target[Key] = MergePatch(Target[Key], Value)
> 
> What is meant by "the Key/Value pair" if there is more than one?
> Are all such pairs to be removed or mutated, or only one of them?

The horse's carcass is so decomposed that you can't even find what to kick anymore. RFC 7159 says "When the names within an object are not unique, the behavior of software that receives such an object is unpredictable." It would be actively harmful for draft-ietf-appsawg-json-merge-patch to say "we can make it predictable in our own unique fashion".

--Paul Hoffman