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

Vinny A <jsontest@yahoo.com> Thu, 06 June 2013 16:40 UTC

Return-Path: <jsontest@yahoo.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 33FB121F99E7 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 09:40:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.287
X-Spam-Level:
X-Spam-Status: No, score=0.287 tagged_above=-999 required=5 tests=[BAYES_05=-1.11, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=1.396]
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 OiXKn1DVWV4O for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 09:40:43 -0700 (PDT)
Received: from nm10-vm2.bullet.mail.gq1.yahoo.com (nm10-vm2.bullet.mail.gq1.yahoo.com [98.136.218.93]) by ietfa.amsl.com (Postfix) with ESMTP id AB81321F99CF for <json@ietf.org>; Thu, 6 Jun 2013 09:40:43 -0700 (PDT)
Received: from [98.137.12.61] by nm10.bullet.mail.gq1.yahoo.com with NNFMP; 06 Jun 2013 16:40:42 -0000
Received: from [208.71.42.192] by tm6.bullet.mail.gq1.yahoo.com with NNFMP; 06 Jun 2013 16:40:42 -0000
Received: from [127.0.0.1] by smtp203.mail.gq1.yahoo.com with NNFMP; 06 Jun 2013 16:40:42 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1370536842; bh=wp1EtBZdm5ShYTsd8FOmMKgYPKgQuSwDQoZCNDNpPBM=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:References:In-Reply-To:Mime-Version:Content-Type:Received:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:Subject:Content-Length:Date:To; b=oQeFn+m3i106xpJXZiGR6IEdNsVrclbFo8SIpqzJ9eVVX3qhwTeNQ+71MhAfQyEzpPTSGa0H4XvKM2qVaoR59ssxaxl9nqwCK97o1bN+F5cSMmDEOeuK8Zw+X4gNWmdz7IJaAWqSOuHr3fpr6I1GpcFDgs6njN0Xc8IbFK9SUno=
X-Yahoo-Newman-Id: 573516.54438.bm@smtp203.mail.gq1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: Qnq1C9MVM1kaOqNS0QjJeNvFEwxrN1TitO9zgT3h2TFLUZp r1KD.2EWQtJhMY.9QvAQfsXtxXRZYk7JbZt9Biz79bCZy01Sm4mslWGQyKse zxiZvf_UrjRTXoilkvlEDgevTiCLyg9iGt7bSQ3GEybCa2JT2LzGFgSywOXo 6EKjlRUm79Di.RuGReYAtSER9fpUlDEHHRcpQmz_JljNNpjtCEy7UxOzjDAS Yty4HAwgnEhrcKx5QwaVydLuFb9MsiZYLQieLW1KmLwHSWEyB1CPOJur_K30 h.MPL6ttLmBs5VFTlQuEKft6XQGrVU34vwHOrLlvi604GTd7h007Pu9KO4wV 2Xrwn3ycQ3mmwUaGCEoEJG4DWi7ObrMCwZUvhVHH0vrh6HKcRBFG_M6_ZIzf KShCSaZ6OAJ7wcv5uS2IHsZA4thVfSJQsI7S4kzfQ0tleeuUiZ5zYVUsilIF ZFZq_Xf6w5XOgLqQXqbb9CWb5a34FZIy5TnlVgtkc6SwH0h1QIGy8kDxkJLd HgukE1ozGxxkXYZpwNZ9GUPT_Dno97w--
X-Yahoo-SMTP: indQcmSswBC8IKsm6t4aCAPskK3T
X-Rocket-Received: from [192.168.0.102] (jsontest@76.29.100.42 with ) by smtp203.mail.gq1.yahoo.com with SMTP; 06 Jun 2013 09:40:42 -0700 PDT
References: <51AF8479.5080002@crockford.com> <51AF9ACF.5020507@cisco.com> <D0A99569-0915-4862-A7AE-9DE51C2E90C0@yahoo.com> <51AFB3F8.8060708@crockford.com> <8F32953C-C788-4DC9-888E-920E2BEB7FDD@yahoo.com> <831B8E46-F239-4353-8F95-8DF3F9BD2E78@yahoo.com> <51AFC924.2030805@crockford.com> <DA7A83A2-1C1F-4E74-BF6A-DA943B07AB59@vpnc.org> <E2E04B23-0853-45B4-A028-5DF467042049@yahoo.com>
In-Reply-To: <E2E04B23-0853-45B4-A028-5DF467042049@yahoo.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="Apple-Mail-D687AAD0-EDC7-4594-9A93-77D6EA212433"
Received: from [76.29.100.42] by web125606.mail.ne1.yahoo.com via HTTP; Thu, 06 Jun 2013 09:33:37 PDT
Content-Transfer-Encoding: 7bit
Message-Id: <386096B1-A43E-43E1-AD03-90424958D9B3@yahoo.com>
X-Mailer: iPod Mail (9B206)
From: Vinny A <jsontest@yahoo.com>
Date: Thu, 06 Jun 2013 11:40:40 -0500
To: Paul Hoffman <paul.hoffman@vpnc.org>
Cc: "json@ietf.org" <json@ietf.org>
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: Thu, 06 Jun 2013 16:40:50 -0000

On Jun 6, 2013, at 10:24 AM, Paul Hoffman <paul.hoffman@vpnc.org> wrote:
> The new text should use language that is already in RFC 4627; "key" is not such a word. To be fair to implementers, the new document also needs to deal with both emitters and parsers.
> 
> Proposal:
> 
> In Section 2.2:
> Current:
>   The names within an object SHOULD be unique.
> Proposed:
>   If the names within an object are not unique, the result of parsing the 
>   object is unpredictable, and the parse may even fail completely. Thus,
>   the names within an object SHOULD be unique.
> 
> In Section 4, add a new paragraph:
>   If a parser encounters an object with duplicate names, the parser MAY
>   fail to parse the JSON text; if the parser accepts objects with duplicate
>   names, it SHOULD accept only the last name/value pair that has the
>   duplicate name. 

If we have to recommend to both parsers and emitters, I'd like to make a slight change to your wording:

In Section 2.2:
Current:
    The names within an object SHOULD be unique.
Proposed:
   The names within an object SHOULD be unique. Non-unique keys have unpredictable effects (refer to sections 4 & 5).

In Section 4 (Parsers) add a new paragraph:
  If a parser encounters an object with duplicate names, the parser MAY fail to parse the JSON text; if the parser accepts objects with duplicate names, it MUST accept only the last name/value pair that has the duplicate name. 

In Section 5 (Generators) add a new paragraph:
   A JSON generator SHOULD not duplicate names. If duplicate names are generated, the authoritative name/value pair MUST be listed last.

-----------------
Vinny
www.jsontest.com