Re: [Json] Counterproposal #2 on work items

Tim Bray <tbray@textuality.com> Thu, 21 February 2013 06:33 UTC

Return-Path: <tbray@textuality.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 1439B21F8DC7 for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 22:33:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.876
X-Spam-Level:
X-Spam-Status: No, score=-2.876 tagged_above=-999 required=5 tests=[AWL=-0.500, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, 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 c1h-9-g889ns for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 22:33:46 -0800 (PST)
Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by ietfa.amsl.com (Postfix) with ESMTP id 2653221F8DB7 for <json@ietf.org>; Wed, 20 Feb 2013 22:33:45 -0800 (PST)
Received: by mail-pb0-f42.google.com with SMTP id xb4so3356005pbc.15 for <json@ietf.org>; Wed, 20 Feb 2013 22:33:45 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=6BAkKELdyEr+X50CXO1O4Or9E/SvZmLzI/jDBTDVKr8=; b=PpPsTzqc8e6ovli5EbYgh7663YBUDmEaRfxLEpcYtGb4IkgjfdlNj7m7YkI3IAwobE 6hYqaKhybard08GGF/EOMDYPUdm6aT0YW6mE9+ILY2yOaHPZQCxMe9AaE7IYuFbYkkkn AM+aX5QmIPfGLdoNcDw3cTUhLmsHfUqNmgAcATItDAUrKm6kbhqrAJNF9uV+V+b2u/iD 8QaE1BNk3BHIA5ldoTh6WiyI+COqFE+s4qE1UOvSHsQJZsGNy//eg+hyizcok2pmE1Ic VjUlAydOrDBH020ESgfC1Ib/fKTRlyOcej/LeGUnbVb5Bnax3AaKtl64+WxM3WSkUcRl f/FQ==
MIME-Version: 1.0
X-Received: by 10.66.155.104 with SMTP id vv8mr6508307pab.165.1361428425516; Wed, 20 Feb 2013 22:33:45 -0800 (PST)
Received: by 10.66.249.129 with HTTP; Wed, 20 Feb 2013 22:33:45 -0800 (PST)
X-Originating-IP: [24.84.235.32]
Received: by 10.66.249.129 with HTTP; Wed, 20 Feb 2013 22:33:45 -0800 (PST)
In-Reply-To: <CAChr6Syimm2whKGVD2rtXimV5k59_wO8_=9EQ4fOWF=BRCUroA@mail.gmail.com>
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> <CAChr6Syimm2whKGVD2rtXimV5k59_wO8_=9EQ4fOWF=BRCUroA@mail.gmail.com>
Date: Wed, 20 Feb 2013 22:33:45 -0800
Message-ID: <CAHBU6ivWtUrJ9nu2XBr7ffTkxoge=AB9gME-n3F2fp6fJfBrXA@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: Robert Sayre <sayrer@gmail.com>
Content-Type: multipart/alternative; boundary="047d7b86c72cb0a59f04d636416f"
X-Gm-Message-State: ALoCoQlslX8fA/61zEcHuo7mV+d0X1bCej7EsvJ1mpUL7ejo0XuXrxjeqtB1e8H2bHqNK9S/gK2j
Cc: Cyrus Daboo <cyrus@daboo.name>, Francis Galiegue <fgaliegue@gmail.com>, Vinny A <jsontest@yahoo.com>, "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>, json@ietf.org
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 06:33:47 -0000

Which was why I was interested in a best-practices spec.  Because it's
basically crazy, in a network protocol, to issue duplicate keys, whether or
not it's legal JSON.  Somewhere this should be stated.

On Feb 20, 2013 9:15 PM, "Robert Sayre" <sayrer@gmail.com> wrote:
>
>
>
> 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
>>> 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