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

Nico Williams <nico@cryptonector.com> Wed, 05 June 2013 23:17 UTC

Return-Path: <nico@cryptonector.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 C361621E804E for <json@ietfa.amsl.com>; Wed, 5 Jun 2013 16:17:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.606
X-Spam-Level:
X-Spam-Status: No, score=-1.606 tagged_above=-999 required=5 tests=[AWL=-0.229, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, J_CHICKENPOX_34=0.6]
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 BxvQunYmE8SM for <json@ietfa.amsl.com>; Wed, 5 Jun 2013 16:17:42 -0700 (PDT)
Received: from homiemail-a32.g.dreamhost.com (caiajhbdccah.dreamhost.com [208.97.132.207]) by ietfa.amsl.com (Postfix) with ESMTP id 8086F21F8C1A for <json@ietf.org>; Wed, 5 Jun 2013 16:17:42 -0700 (PDT)
Received: from homiemail-a32.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a32.g.dreamhost.com (Postfix) with ESMTP id 7EB8058406F for <json@ietf.org>; Wed, 5 Jun 2013 16:16:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=XTlFCUYTDr+ANAn43jvl KVDbTjE=; b=aduaNXNk+gmHfNzhWz7AYTejZG/5YTLUCgj0ExfQ2U7jPE7k/OGA GuWKEldCrGcx+Znj5cY/eFX2JzSK+o+n6Ab3SmQrNtgAMWRfMNRWfdfJNlu6S4LZ zUBVXrBPrCuk3RKzxZHvKgRkr5KplGm0leMODm6pzDpGTKQI2O+8giU=
Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a32.g.dreamhost.com (Postfix) with ESMTPSA id 262C658406A for <json@ietf.org>; Wed, 5 Jun 2013 16:16:56 -0700 (PDT)
Received: by mail-ea0-f182.google.com with SMTP id r16so1800979ead.41 for <json@ietf.org>; Wed, 05 Jun 2013 16:16:55 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0qjXSAy99zYFDpVR7+Bga0iT8JtgO6vtWUyPA/RYC54=; b=Q57Js6mLcfiRDgK0ZafgFiwnjjjX9k/ZsCKpu5cuE3e1dwU/cs63qPAGrqZE5bKYBX cSEezXt+I3gBKmIwEN6/eB4pnqTQEJccK0OKTVlNfrn7uiPstaNSY7vhYI1CmmJXr5TA 24VA1jxKFIsDPTGg4NK3Ra48Ib+L3W/BXEoNU+S4U4svuE0rokwdXLmkvmfG9Hz1tanp BymzuC5GHH3SJ10/iVG8lYFO3vY4GXybwdn4xX6spqIIXXxqxNtMSqUejRjw6zy/vrC+ TfBjXdI4faTFM2C0zjKjbauOehGkTOYjUs80rTNxxEK59TodFSDkuJmTSFT/uQ9AJUvo ZzVg==
MIME-Version: 1.0
X-Received: by 10.194.77.66 with SMTP id q2mr30849458wjw.34.1370474215504; Wed, 05 Jun 2013 16:16:55 -0700 (PDT)
Received: by 10.216.63.136 with HTTP; Wed, 5 Jun 2013 16:16:55 -0700 (PDT)
In-Reply-To: <D0A99569-0915-4862-A7AE-9DE51C2E90C0@yahoo.com>
References: <51AF8479.5080002@crockford.com> <51AF9ACF.5020507@cisco.com> <D0A99569-0915-4862-A7AE-9DE51C2E90C0@yahoo.com>
Date: Wed, 05 Jun 2013 18:16:55 -0500
Message-ID: <CAK3OfOgTJPP2PgB0feS1aQ_r58GpM2sRzEJf07dY-52MiASU2g@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Vinny A <jsontest@yahoo.com>
Content-Type: text/plain; charset="UTF-8"
Cc: Douglas Crockford <douglas@crockford.com>, Eliot Lear <lear@cisco.com>, "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: Wed, 05 Jun 2013 23:17:57 -0000

On Wed, Jun 5, 2013 at 3:59 PM, Vinny A <jsontest@yahoo.com> wrote:
> If parsers are accepting duplicate keys, they're already non-compliant. RFC
> 4627 states that keys should be unique, and the org.json reference parser
> throws an exception when it hits a duplicate key (line 1186 in JSONObject).

Not clear.  The RFC uses a passive voice here, not placing a
requirement (or, rather, recommendation) on either the encoder nor the
parser.  It seems more reasonable to read it as a recommendation for
encoders than one for parsers.  I note that the words "reject",
"fail", and "error" don't appear in the RFC, lending even more weight,
I think to the interpretation that this SHOULD applies to encoders.

Perhaps that should be an action item here: change from passive voice
to active as much as possible, with discussion of why some ambiguity
(like this one) is left in, if it is.

Nico
--