Re: [Json] RFC 4627bis vs RFC 6902 (JSON Patch)

Carsten Bormann <cabo@tzi.org> Thu, 20 February 2014 17:50 UTC

Return-Path: <cabo@tzi.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 6CB091A023E for <json@ietfa.amsl.com>; Thu, 20 Feb 2014 09:50:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.551
X-Spam-Level:
X-Spam-Status: No, score=-1.551 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, SPF_HELO_PASS=-0.001] 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 sRnDmp-2NfO8 for <json@ietfa.amsl.com>; Thu, 20 Feb 2014 09:50:55 -0800 (PST)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id 1D0401A0235 for <json@ietf.org>; Thu, 20 Feb 2014 09:50:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id s1KHomLV001416; Thu, 20 Feb 2014 18:50:49 +0100 (CET)
Received: from [192.168.217.106] (p54891BBF.dip0.t-ipconnect.de [84.137.27.191]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id 2241C365; Thu, 20 Feb 2014 18:50:47 +0100 (CET)
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CALcybBBmkhwFWiqB+3Fz8vpLm1WZwmoXTkDi9FUhZY8Ftnj0dw@mail.gmail.com>
Date: Thu, 20 Feb 2014 18:50:46 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <4C987A55-8D98-469F-A35A-6CC4D73F79FA@tzi.org>
References: <CALcybBCTih9A6RL=r4WYrqf05rHsjgF4tEJP3cTY2FAmONRQaw@mail.gmail.com> <CAC4RtVD5J2oeTQGDNW5=M1oO4MuY_7i7z9G1Q=+icLr9su8aUQ@mail.gmail.com> <CALcybBBmkhwFWiqB+3Fz8vpLm1WZwmoXTkDi9FUhZY8Ftnj0dw@mail.gmail.com>
To: Francis Galiegue <fgaliegue@gmail.com>
X-Mailer: Apple Mail (2.1827)
Archived-At: http://mailarchive.ietf.org/arch/msg/json/6vx964Dk6r1bJ4eCeVhQIRNkjo4
Cc: Barry Leiba <barryleiba@computer.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] RFC 4627bis vs RFC 6902 (JSON Patch)
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: Thu, 20 Feb 2014 17:50:56 -0000

On 20 Feb 2014, at 18:35, Francis Galiegue <fgaliegue@gmail.com> wrote:

> Not to me. As I see it, 75+% of JSON parsers on the "market" just
> cannot parse JSON Patch correctly because of the restrictions imposed
> by RFC 6902. Note: parse, not emit (or "consume, not produce" -- or
> whatever metaphor suits you).

“cannot parse”?  I don’t think so.
I think what you are trying to achieve is “reliably detect and reject input that causes unpredictable behavior”.
This is a quality-of-implementation expectation for a parser that is often traded for performance, and rightly so.
Instead, the behavior is indeed unpredictable, just as the specification says.

I’m with Barry on this one: This is completely consistent.
(Except that I wouldn’t summarize 4627bis as “allows duplicate keys”.  
Sure, it also “allows" hitting yourself on the head with a hammer.
But here, it explicitly warns that its sole objective, interoperability, is not achievable if you do that.)

Grüße, Carsten