Re: [Json] The names within an object SHOULD be unique.

Jorge Chamorro <jorge@jorgechamorro.com> Sun, 28 July 2013 01:28 UTC

Return-Path: <jorge@jorgechamorro.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 7A89511E812B for <json@ietfa.amsl.com>; Sat, 27 Jul 2013 18:28:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J4hYzbZm5Xwq for <json@ietfa.amsl.com>; Sat, 27 Jul 2013 18:28:18 -0700 (PDT)
Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by ietfa.amsl.com (Postfix) with ESMTP id 4A82711E811F for <json@ietf.org>; Sat, 27 Jul 2013 18:28:17 -0700 (PDT)
Received: by mail-wi0-f174.google.com with SMTP id j17so1400294wiw.7 for <json@ietf.org>; Sat, 27 Jul 2013 18:28:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=vKGqP0+/VlXmDhG5o1OB7pB3r60MBxkLsAEtsW+qzn8=; b=BFJpAYiIbEewhUZYDPHl0jf7CL8E40/v9653wEVMdm4wiVSKLClDlQaTr7ypp2PoGd R2Vy/lFvCRnU8UHEtDsjjDCVgOgPwnA6JkAkD3dQNtTCut2FBkYOV4fyHIG4ZlG8goNl 3kBLmbFvWfZ/8i/U1gPrhNwNEJICsU+37ZotR2qpp78UEr93OMJsZcfVPzhFwIR7/D90 IS6Ydsv87XfPGw+mXAgAJzg9rq/GQ9kyxkIU/EWaJ9/Aw50+zqBpwPfsGQBuwqzDQjjE dSeAIi6Mw00snPyjIr+WIsv2ahOrLuSNdHOaJpfX8qN7wtzEoRPIy/fpKWb+K1MpclBv PjVw==
X-Received: by 10.194.103.73 with SMTP id fu9mr38587637wjb.70.1374974895907; Sat, 27 Jul 2013 18:28:15 -0700 (PDT)
Received: from [192.168.10.50] (4.Red-83-41-147.dynamicIP.rima-tde.net. [83.41.147.4]) by mx.google.com with ESMTPSA id n14sm1959223wie.9.2013.07.27.18.28.14 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Jul 2013 18:28:15 -0700 (PDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Apple Message framework v1085)
From: Jorge Chamorro <jorge@jorgechamorro.com>
In-Reply-To: <20130727224613.GE6846@mercury.ccil.org>
Date: Sun, 28 Jul 2013 03:28:12 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <A9D21722-4506-4F40-B177-95A245988999@jorgechamorro.com>
References: <51AF8479.5080002@crockford.com> <CAK3OfOgtYoPRZ-Gj5G8AnNipDyxYs=6_KD=rQTxKbhDPX6FZNA@mail.gmail.com> <51b1168c.e686440a.5339.5fc4SMTPIN_ADDED_BROKEN@mx.google.com> <CAK3OfOhL3zXHfg9EEDWLXhjLQ1aBvvxikKAiR+nUpDHJaVh+Qg@mail.gmail.com> <51B1B47C.9060009@drees.name> <C86A9758-5BEF-415C-BD17-DC5E757FAA7E@yahoo.com> <51B1E909.2010402@drees.name> <CA+mHimN9=VZu4RRWcnk2F_uMi-+E-LDN2stb1MFNDP+o1R0WSg@mail.gmail.com> <EEDD52B0-4577-4789-A3C6-586C3D95D81C@jorgechamorro.com> <20130727224613.GE6846@mercury.ccil.org>
To: John Cowan <cowan@mercury.ccil.org>, "json@ietf.org WG" <json@ietf.org>
X-Mailer: Apple Mail (2.1085)
X-Gm-Message-State: ALoCoQk7CH3ZIgJS9ra2vD/1ket2SASnaZ9gxn9QaHfZx2Lrf22gEHfkkEMqjpHRzBwSMHU9hDma
Subject: Re: [Json] The names within an object SHOULD be unique.
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: Sun, 28 Jul 2013 01:28:24 -0000

On 28/07/2013, at 00:46, John Cowan wrote:
> Jorge Chamorro scripsit:
> 
>> If duplicate names are generally considered a no-no, and given that
>> they're mostly used for comments (usually with the key "//"), and
>> given the security risks discussed in the "command":"launch-missiles"
>> thread, perhaps the best thing to do with the duplicate keys and their
>> values might be to simply drop them altogether, not throw any errors,
>> not nothing, just drop them, all of them, including the last one.
> 
> This ignores a very important reason for not defining what to do with them,
> which is so that streaming generators and parsers don't have to keep track
> of what keys they have already processed.

Yes, but it's problematic only for the streaming parsers that emit [key,value] pairs, not for those which emit entire objects.

In parsers that emit [key,value] pairs perhaps it doesn't even make sense to expect this behaviour, probably where it belongs is in the next layer.
-- 
( Jorge )();