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

Bjoern Hoehrmann <> Sun, 07 July 2013 13:35 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 6BEC521F9EED for <>; Sun, 7 Jul 2013 06:35:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.544
X-Spam-Status: No, score=-2.544 tagged_above=-999 required=5 tests=[AWL=0.055, BAYES_00=-2.599]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id WaQHVZXafYG0 for <>; Sun, 7 Jul 2013 06:35:18 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id CF79E21F9E2E for <>; Sun, 7 Jul 2013 06:35:17 -0700 (PDT)
Received: from =?utf-8?q?netb.Speedport=5fW=5f700V?= ([]) by (mrgmx101) with ESMTPA (Nemesis) id 0M3vCA-1U5dxp0QDq-00rYvw; Sun, 07 Jul 2013 15:34:46 +0200
From: Bjoern Hoehrmann <>
To: John Cowan <>
Date: Sun, 07 Jul 2013 15:34:46 +0200
Message-ID: <>
References: <> <> <> <> <00cd01ce7a9f$19adeaa0$4d09bfe0$> <00d701ce7aa6$cc5fe700$651fb500$> <> <00e401ce7ad5$00991c20$01cb5460$> <>
In-Reply-To: <>
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' <>, Jim Schaad <>,
Subject: Re: [Json] Duplicate names: are they erroneous or not?
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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 · ·
Am Badedeich 7 · Telefon: +49(0)160/4415681 ·
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 ·