Re: [Json] Counterproposal #2 on work items

Cyrus Daboo <cyrus@daboo.name> Thu, 21 February 2013 04:14 UTC

Return-Path: <cyrus@daboo.name>
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 DAB4C21E808D for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 20:14:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.474
X-Spam-Level:
X-Spam-Status: No, score=-104.474 tagged_above=-999 required=5 tests=[AWL=-2.475, BAYES_00=-2.599, J_CHICKENPOX_34=0.6, USER_IN_WHITELIST=-100]
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 h4yXtpSlgiNq for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 20:14:33 -0800 (PST)
Received: from daboo.name (daboo.name [173.13.55.49]) by ietfa.amsl.com (Postfix) with ESMTP id 4311321E8055 for <json@ietf.org>; Wed, 20 Feb 2013 20:14:33 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by daboo.name (Postfix) with ESMTP id D47783DC3AF9; Wed, 20 Feb 2013 23:14:32 -0500 (EST)
X-Virus-Scanned: amavisd-new at example.com
Received: from daboo.name ([127.0.0.1]) by localhost (daboo.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kyBB_r82H7XX; Wed, 20 Feb 2013 23:14:32 -0500 (EST)
Received: from [17.45.162.188] (unknown [173.13.55.49]) by daboo.name (Postfix) with ESMTPSA id 600E63DC3AE9; Wed, 20 Feb 2013 23:14:31 -0500 (EST)
Date: Wed, 20 Feb 2013 23:14:44 -0500
From: Cyrus Daboo <cyrus@daboo.name>
To: Vinny A <jsontest@yahoo.com>, Francis Galiegue <fgaliegue@gmail.com>
Message-ID: <4E2B71678D46B212D1553AD2@cyrus.local>
In-Reply-To: <1361419333.51990.YahooMailNeo@web125604.mail.ne1.yahoo.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>
X-Mailer: Mulberry/4.1.0a3 (Mac OS X)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; size=812
Cc: Tim Bray <tbray@textuality.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 04:14:34 -0000

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.

-- 
Cyrus Daboo