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

"Pete Cordell" <petejson@codalogic.com> Thu, 06 June 2013 17:50 UTC

Return-Path: <petejson@codalogic.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 BE16E21F9AA2 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 10:50:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.932
X-Spam-Level:
X-Spam-Status: No, score=-0.932 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, SARE_HEAD_XUNSENT=1.666, STOX_REPLY_TYPE=0.001]
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 S6wO8XE1wVKM for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 10:50:11 -0700 (PDT)
Received: from codalogic.com (codalogic.com [94.136.60.219]) by ietfa.amsl.com (Postfix) with ESMTP id 7AC0621F9AE2 for <json@ietf.org>; Thu, 6 Jun 2013 10:50:09 -0700 (PDT)
Received: (qmail 28170 invoked from network); 6 Jun 2013 18:50:05 +0100
Received: from host86-132-241-164.range86-132.btcentralplus.com (HELO codalogic) (86.132.241.164) by codalogic.com with (RC4-MD5 encrypted) SMTP; 6 Jun 2013 18:50:05 +0100
Message-ID: <5781A1976FE5419DAF8EF46B480E420B@codalogic>
From: Pete Cordell <petejson@codalogic.com>
To: Tatu Saloranta <tsaloranta@gmail.com>, Stephan Beal <sgbeal@googlemail.com>
X-Unsent: 1
References: <51AF8479.5080002@crockford.com><CAHBU6iuBhjYOVbqWE1ANvCtOw5QOUM0LWYJCsiX5DRrVaY=iKA@mail.gmail.com><51AF8A9B.1020900@crockford.com><51af8f23.85f8420a.597e.0ccbSMTPIN_ADDED_BROKEN@mx.google.com><CAKd4nAi31WC_t5QYhJCvdKFHU_ZfzZ4c9fpL0v2bd+q2p0RAtA@mail.gmail.com><CAK3OfOhJf4k5TR5GGJ4dZs1zeC5nEiurnEn7ih5Uo5TRd+pB+Q@mail.gmail.com><51afa4ff.89e9420a.6d90.212fSMTPIN_ADDED_BROKEN@mx.google.com><CAK3OfOh9X-J8sO+PzSeAbwxG_qiN4qm_qrdM3hPO1y0Tv15PHA@mail.gmail.com><CAKd4nAidrsj8QGC2a=hpb8UqUmUNrLMKY+6ei1Z-iDvMiBShaQ@mail.gmail.com> <CAGrxA25zg+qWarxFxFFXaV99rc5Z=xR4SxX+y0WsALD9ywjDWA@mail.gmail.com>
x-vipre-scanned: 0243A29800482A0243A3E5
Date: Thu, 06 Jun 2013 18:50:05 +0100
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="iso-8859-1"; reply-type="original"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Cc: 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 17:50:15 -0000

Original Message From: "Tatu Saloranta" .


> For these reasons, I would prefer simple discouraging use of duplicate
> names, without trying to specify "but if you must, then use X" processing.


+1.

(editing text suggested elsewhere) Can you scare the heck out of 
implementers by saying something like:

In Section 4 (Parsers) add a new paragraph:
   If a parser encounters an object with duplicate names, the behavior is 
undefined.  The parser MAY fail to parse the JSON text, it MAY only accept 
the first name/value pair that has the duplicate name, it MAY only accept 
the last name/value pair that has the duplicate name, it MAY ignore all 
name/value pair that have the duplicate name, or it MAY perform some other 
action.

In Section 5 (Generators) add a new paragraph:
    A JSON generator SHOULD not duplicate names.

Pete Cordell
Codalogic Ltd
C++ tools for C++ programmers, http://codalogic.com
Read & write XML in C++, http://www.xml2cpp.com