Re: [Json] Duplicate names: are they erroneous or not?

Bjoern Hoehrmann <derhoermi@gmx.net> Sun, 07 July 2013 13:35 UTC

Return-Path: <derhoermi@gmx.net>
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 6BEC521F9EED for <json@ietfa.amsl.com>; Sun, 7 Jul 2013 06:35:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.544
X-Spam-Level:
X-Spam-Status: No, score=-2.544 tagged_above=-999 required=5 tests=[AWL=0.055, BAYES_00=-2.599]
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 WaQHVZXafYG0 for <json@ietfa.amsl.com>; Sun, 7 Jul 2013 06:35:18 -0700 (PDT)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by ietfa.amsl.com (Postfix) with ESMTP id CF79E21F9E2E for <json@ietf.org>; Sun, 7 Jul 2013 06:35:17 -0700 (PDT)
Received: from netb.Speedport_W_700V ([91.35.20.89]) by mail.gmx.com (mrgmx101) with ESMTPA (Nemesis) id 0M3vCA-1U5dxp0QDq-00rYvw; Sun, 07 Jul 2013 15:34:46 +0200
From: Bjoern Hoehrmann <derhoermi@gmx.net>
To: John Cowan <cowan@mercury.ccil.org>
Date: Sun, 07 Jul 2013 15:34:46 +0200
Message-ID: <i7oit8t21l2vrstfsum32vafpriic66u7t@hive.bjoern.hoehrmann.de>
References: <CAK3OfOj3MNNhjwo2bMa5CgoqynzMRVvviBXC8szxt5D17Z7FDg@mail.gmail.com> <51D3C63C.5030703@cisco.com> <51D48023.1020008@qti.qualcomm.com> <20130703201143.GL32044@mercury.ccil.org> <00cd01ce7a9f$19adeaa0$4d09bfe0$@augustcellars.com> <00d701ce7aa6$cc5fe700$651fb500$@augustcellars.com> <CAK3OfOiWrWCvNQneokyycV1Jb98M=UR-U7z0dhxUjzVdf+PwDw@mail.gmail.com> <00e401ce7ad5$00991c20$01cb5460$@augustcellars.com> <20130707055338.GB2947@mercury.ccil.org>
In-Reply-To: <20130707055338.GB2947@mercury.ccil.org>
X-Mailer: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:ZLFuzQ4BgXXhcwjlr7oEbyC89MK2uEEe0bnOeQhUxbCQd2bipTj YQQehFB3jEJXvVQEtJF0MKh/NaWTsLZ6JGHF9lZ3vB7yugsw5QSlMLWZ2BaUDTNkfTR6qKG BFNI2t1Z7/+zu17iUt69zUKlLBrMhK4H/W86+3jv/QJtvKJcHhmAws8ljhg1rC8T7qRpXEI 3XSgUABj6ap2jghuN7yOA==
Cc: 'Nico Williams' <nico@cryptonector.com>, Jim Schaad <ietf@augustcellars.com>, json@ietf.org
Subject: Re: [Json] Duplicate names: are they erroneous or not?
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, 07 Jul 2013 13:35:22 -0000

* John Cowan wrote:
>What I wish to avoid is a specification that says that having two
>fields of the same name in an object is a perfectly okay thing to do.
>In other words, such documents for my purposes have to be erroneous,
>rather than a legitimate way of encoding multimaps.  Is there anyone
>who can't live with that restriction?

The current text is "The names within an object SHOULD be unique". That
makes it clear that you might encounter duplicate names in the wild and
that your parser might not report it when it finds repeated names. That
is the running code situation and so I would oppose making it a "MUST".

>If there isn't anyone, then we can talk about whether this is an error
>that generators and/or parsers MUST or SHOULD detect.  But if we can't
>even get consensus on that much, it's futile to discuss parser or
>generator behavior.

People who would like JSON parsers to detect repeated names in objects
are welcome to implement and deploy and evangelise them; and when other
parsers have become the exception, then it might be useful to capture
that reality in an updated specification. Right now parsers usually do
not detect repeated names and so it would be incorrect to tell people
they can expect parsers to detect repeated names.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/