Re: [Json] Counterproposal #2 on work items

Robert Sayre <sayrer@gmail.com> Thu, 21 February 2013 05:15 UTC

Return-Path: <sayrer@gmail.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 ABCD121E80A0 for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 21:15:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.099
X-Spam-Level:
X-Spam-Status: No, score=-3.099 tagged_above=-999 required=5 tests=[AWL=-0.100, BAYES_00=-2.599, HTML_MESSAGE=0.001, J_CHICKENPOX_34=0.6, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q0j3GuQiaxuL for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 21:15:39 -0800 (PST)
Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by ietfa.amsl.com (Postfix) with ESMTP id A43CD21F841D for <json@ietf.org>; Wed, 20 Feb 2013 21:15:38 -0800 (PST)
Received: by mail-wi0-f171.google.com with SMTP id hn17so7051378wib.16 for <json@ietf.org>; Wed, 20 Feb 2013 21:15:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=GaNTw069SdTQdBtne7lBI3MTx3r09WowCd6WPXb/DUk=; b=f9noZfIv84IG1+mlPFBtRGgxGPTkd6E7PE04pm4uy0XaPiRc9867YCETqu/fOy1dqZ ygC+1OPgWxFGCPEF3lMuV+QHvh/A8yXD4EIBbULOY5moqK9FE/jScOWYctpQtVO+9FV9 JPEM95cOQx6wtnmQZXYIylSpqE0+lgwaSq9KrTCtTyKazmzDOFZLRO+oLCueuYtDEI+8 PyE5/jYTPDkLpexBHqDvr+i4Nvqyzxo4l8s0LJCyrLCB5e8bR7hKZztGrKBFtdb2zNfQ yP+gH+59I9VKE33UviUwVQrVMHOoUpOuVAwIIFHlPWUGtnj78/4B5WZxdwFy3wlV8+Nm sZzw==
MIME-Version: 1.0
X-Received: by 10.180.91.106 with SMTP id cd10mr20036488wib.6.1361423737852; Wed, 20 Feb 2013 21:15:37 -0800 (PST)
Received: by 10.194.138.170 with HTTP; Wed, 20 Feb 2013 21:15:37 -0800 (PST)
In-Reply-To: <4E2B71678D46B212D1553AD2@cyrus.local>
References: <CALcybBC87P7FT7n5d8xmXMxSFU1LBS9eJUsRX4hfYP5CUJr3QA@mail.gmail.com> <A723FC6ECC552A4D8C8249D9E07425A70F89B751@xmb-rcd-x10.cisco.com> <CALcybBBSL3w1-JRzUVWMmfS+jzytKNOv6omD1cR+_CLjze6WsA@mail.gmail.com> <12CE5BFB-49C5-48D0-96DF-F78F0D60578A@yahoo.com> <CALcybBCJ=z6u=1CGURB4ECoOaOA1igDy0H64fRm5Sj1HWQcRCg@mail.gmail.com> <1361419333.51990.YahooMailNeo@web125604.mail.ne1.yahoo.com> <4E2B71678D46B212D1553AD2@cyrus.local>
Date: Wed, 20 Feb 2013 21:15:37 -0800
Message-ID: <CAChr6Syimm2whKGVD2rtXimV5k59_wO8_=9EQ4fOWF=BRCUroA@mail.gmail.com>
From: Robert Sayre <sayrer@gmail.com>
To: Cyrus Daboo <cyrus@daboo.name>
Content-Type: multipart/alternative; boundary=f46d043be11a48920604d6352a72
Cc: Vinny A <jsontest@yahoo.com>, "json@ietf.org" <json@ietf.org>, Tim Bray <tbray@textuality.com>, "Joe Hildebrand \(jhildebr\)" <jhildebr@cisco.com>, Francis Galiegue <fgaliegue@gmail.com>
Subject: Re: [Json] Counterproposal #2 on work items
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Discussion related to JavaScript Object Notation \(JSON\)." <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, 21 Feb 2013 05:15:40 -0000

On Wednesday, February 20, 2013, Cyrus Daboo wrote:

> Hi Vinny,
>
> --On February 20, 2013 8:02:13 PM -0800 Vinny A <jsontest@yahoo.com>
> wrote:
>
>  I believe org.json throws a exception if it hits a duplicated key; at
>> least the documentation [
>> http://json.org/javadoc/org/**json/JSONObject.html#**
>> JSONObject(java.lang.Str<http://json.org/javadoc/org/json/JSONObject.html#JSONObject(java.lang.Str>
>> ing) ] suggests that to be the case. I don't remember where I saw the
>> append to array parser - but it's such a good idea it's worth bringing up
>> in this conversation.
>>
>
> Another data point: Python 2.7.2 -
>
>  import json
>>>> print json.loads('{"a":"a", "a":"b"}')
>>>>
>>> {u'a': u'b'}
>
> So Python will accept duplicate keys, but one value is lost. This makes
> sense since keys in Python dicts are unique. At this point I favor changing
> the SHOULD to a MUST in RFC 4627bis to make it clear that there is lack of
> interoperability here.
>

There is a lack of interoperability, and this issue is one of the smaller
points. The larger point is that the JS implementations (and many smaller
ones) have no incentive to change their behavior, and what they do is
reasonable. Let's just do that.

- Rob