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

Tatu Saloranta <tsaloranta@gmail.com> Thu, 06 June 2013 17:32 UTC

Return-Path: <tsaloranta@gmail.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 2C34021F9339 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 10:32:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.532
X-Spam-Level:
X-Spam-Status: No, score=-1.532 tagged_above=-999 required=5 tests=[AWL=1.067, BAYES_00=-2.599, HTML_MESSAGE=0.001, NO_RELAYS=-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 ShgPCGAUtCi8 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 10:32:10 -0700 (PDT)
Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) by ietfa.amsl.com (Postfix) with ESMTP id 24DE921F9959 for <json@ietf.org>; Thu, 6 Jun 2013 10:32:04 -0700 (PDT)
Received: by mail-wg0-f44.google.com with SMTP id m15so1286513wgh.23 for <json@ietf.org>; Thu, 06 Jun 2013 10:32:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qCfiOdDF0zTsFUTp0yGiefmfYrvqvDUh/0P0nVS7ap8=; b=C+LTVANYlzBWXyQfgMYI6oa2/6R0viTQ88kpBcvgGMPgiErXqwjiRno5e6h+4rpdNl uBe+VBf8MaQVD/9xNR80c4kGO3shvT7bKf3/Qud7UDKyjyhxmcKcBfInGwIRqucupJWl fkS8PrH1bz+UpAkhYm8Lo7zMb7cIHRCNP7fWjYzWOvXvnNpwXrKcR0iedAls2B0JfRJd r/CBANko9seN5HnthEUPf2jLZU1AxT6yHgiQrAmBisRsR/oiK+1NLoenIMlA4hmwerCp xzDVhV7EyzpFHA9kiW6Bd9w5JbH87Cg6njSOCU6gn09BD+eau93nJzRLSjqHMFNRUki7 sF/w==
MIME-Version: 1.0
X-Received: by 10.180.7.230 with SMTP id m6mr3121003wia.55.1370539924046; Thu, 06 Jun 2013 10:32:04 -0700 (PDT)
Received: by 10.227.97.6 with HTTP; Thu, 6 Jun 2013 10:32:03 -0700 (PDT)
In-Reply-To: <CAKd4nAidrsj8QGC2a=hpb8UqUmUNrLMKY+6ei1Z-iDvMiBShaQ@mail.gmail.com>
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>
Date: Thu, 06 Jun 2013 10:32:03 -0700
Message-ID: <CAGrxA25zg+qWarxFxFFXaV99rc5Z=xR4SxX+y0WsALD9ywjDWA@mail.gmail.com>
From: Tatu Saloranta <tsaloranta@gmail.com>
To: Stephan Beal <sgbeal@googlemail.com>
Content-Type: multipart/alternative; boundary="f46d044403b853af9a04de7fb13b"
Cc: "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: Thu, 06 Jun 2013 17:32:11 -0000

On Thu, Jun 6, 2013 at 7:55 AM, Stephan Beal <sgbeal@googlemail.com> wrote:

>
> On Thu, Jun 6, 2013 at 1:19 AM, Nico Williams <nico@cryptonector.com>wrote:
>
>> Oh, this might actually be important.  Perhaps the best way to handle
>>  comments is to have the "schema" (if there is one, stated or
>> otherwise) specify some keys as being comments, but that doesn't help
>> for free-form data.
>>
>
> This brings with it a performance penalty because all keys being slurped
> up now have to be checked against a whitelist/blacklist of keys.
>
>
And if generators were to be prohibited from outputting duplicates, they
too must keep track of all keys for all open object contexts

I think it is reasonable to point out that use of duplicate keys is not
supported, nor should systems rely on such usage working. In fact, NOT
specifying proper handling for this case may be better for
interoperability; if specific "use first" or "use last" is sanctioned, it
will be more likely to support usage of multiple instances. Furthermore,
mandating one or the other will hurt some use cases; for "use first",
decoder/parser must keep information around to suppress (or error on)
multiples.
And "use last" case would be impractical for purely streaming
implementation since it is impossible to force such usage without buffering
the whole content to determine value to use.

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

-+ Tatu +-