[Json] Proposed minimal change for duplicate names in objects

Paul Hoffman <paul.hoffman@vpnc.org> Tue, 02 July 2013 23:25 UTC

Return-Path: <paul.hoffman@vpnc.org>
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 CE67C11E80F3 for <json@ietfa.amsl.com>; Tue, 2 Jul 2013 16:25:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.599
X-Spam-Level:
X-Spam-Status: No, score=-102.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 1uqc2QJfLTcc for <json@ietfa.amsl.com>; Tue, 2 Jul 2013 16:25:51 -0700 (PDT)
Received: from hoffman.proper.com (IPv6.Hoffman.Proper.COM [IPv6:2605:8e00:100:41::81]) by ietfa.amsl.com (Postfix) with ESMTP id 5003611E80EC for <json@ietf.org>; Tue, 2 Jul 2013 16:25:51 -0700 (PDT)
Received: from [10.20.30.90] (50-1-98-228.dsl.dynamic.sonic.net [50.1.98.228]) (authenticated bits=0) by hoffman.proper.com (8.14.5/8.14.5) with ESMTP id r62NPnbK017500 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for <json@ietf.org>; Tue, 2 Jul 2013 16:25:49 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
From: Paul Hoffman <paul.hoffman@vpnc.org>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Message-Id: <B86E1D4B-1DC8-4AD6-B8B3-E989599E0537@vpnc.org>
Date: Tue, 2 Jul 2013 16:25:48 -0700
To: "json@ietf.org WG" <json@ietf.org>
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
X-Mailer: Apple Mail (2.1508)
Subject: [Json] Proposed minimal change for duplicate names in objects
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: Tue, 02 Jul 2013 23:25:51 -0000

<chair hats on>

Do either or both of these proposals work for people in the WG?

--Matt Miller and Paul Hoffman

The following are proposed minimal changes to make the JSON spec interoperable with respect to
objects that have duplicate names.

Proposal 1:

In section 2.2 (Grammar -> Objects):
  No change
In section 4 (Parsers):
  Add: "If a parser encounters an object with duplicate names, the parser MUST use only the last
  name/value pair that has the duplicate name.
In section 5 (Generators):
  Add: "The names within an object SHOULD be unique."

Proposal 2:

Same as Proposal 1 *except* that a second sentence is added for section 4: "A parser that streams
  its outputs MUST fail to finish parsing if it encounters more than one name/value pair with the
  same name."