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

"Markus Lanthaler" <markus.lanthaler@gmx.net> Wed, 05 June 2013 20:52 UTC

Return-Path: <markus.lanthaler@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 20B7021F90EF for <json@ietfa.amsl.com>; Wed, 5 Jun 2013 13:52:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.593
X-Spam-Level:
X-Spam-Status: No, score=-0.593 tagged_above=-999 required=5 tests=[AWL=0.557, BAYES_00=-2.599, MSGID_MULTIPLE_AT=1.449]
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 g+FmhmGixwWI for <json@ietfa.amsl.com>; Wed, 5 Jun 2013 13:52:20 -0700 (PDT)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by ietfa.amsl.com (Postfix) with ESMTP id F2F1821F909A for <json@ietf.org>; Wed, 5 Jun 2013 13:52:18 -0700 (PDT)
Received: from mailout-de.gmx.net ([10.1.76.30]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LcE27-1U0mim3Sx3-00jXyV for <json@ietf.org>; Wed, 05 Jun 2013 22:52:13 +0200
Received: (qmail invoked by alias); 05 Jun 2013 20:52:13 -0000
Received: from 84-115-182-43.dynamic.surfer.at (EHLO Vostro3500) [84.115.182.43] by mail.gmx.net (mp030) with SMTP; 05 Jun 2013 22:52:13 +0200
X-Authenticated: #419883
X-Provags-ID: V01U2FsdGVkX1/mAMFLwJrmdKwUQtQMqxcwFhCYYXzeFE7pmpLGce nACmJv/8rd8DZP
From: Markus Lanthaler <markus.lanthaler@gmx.net>
To: 'Nico Williams' <nico@cryptonector.com>, 'Stephan Beal' <sgbeal@googlemail.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>
In-Reply-To: <CAK3OfOhJf4k5TR5GGJ4dZs1zeC5nEiurnEn7ih5Uo5TRd+pB+Q@mail.gmail.com>
Date: Wed, 05 Jun 2013 22:52:08 +0200
Message-ID: <043f01ce622e$8c20f1b0$a462d510$@lanthaler>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac5iJ6FQ2SrTxenVQA+npbcVvgX75gABhE1A
Content-Language: de
X-Y-GMX-Trusted: 0
Cc: 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 20:52:27 -0000

On Wednesday, June 05, 2013 9:56 PM, Nico Williams wrote:
> On Wed, Jun 5, 2013 at 2:30 PM, Stephan Beal wrote:
>> i wouldn't quite go so far as to say it's strictly historical in nature. It
>> gives implementations leeway on what is essentially a corner case (who
>> actively generates non-unique keys?). Forcing a specific behaviour here
> 
> If no one does that then we can make a "breaking" change here that
> breaks no one, no?  (I'm being the devil's advocate here.)

I've seen people using this for comments. People relied on the fact that serializers ignored all but the last occurrence of a key.


> > could potentially leave a lot of current 100% JSON-compliant parsers
> > suddenly non-compliant because of [what i perceive as] an unusual
> > corner case. Pointing it out as a potential pitfall, sure, but i
> > wouldn't claim that it's "historical baggage."
> 
> There's no compliance police here.  If some change merely leaves us
> with non-compliant implementations then maybe I don't care, after all
> they'd still compliant with the old RFC and could be updated to be
> compliant with the new one.  But we mustn't break interoperability any
> more than it already was.  If indeed there are senders with duplicate
> keys (and different values) that alternately get to talk to receivers
> that take the first or last key, then there's already broken interop,
> so picking one of the two should be fair game.  But I bet we have
> little real data on this, so we'll end up assuming that such a change
> can break interop.

I think we have to choose one to get interoperability. I've seen some systems that merge the values of multiple keys in an array but most do what JavaScript does, i.e., they ignore all but the last key.


I really like the proposal Eliot Lear made in another thread:

> Demonstrating my age, an old trick we've done that goes back to RFC-
> 1123 is to say MUST NOT send, and then implementations MAY NOT process,
> and if they do MUST process thusly...
> 
> That gives you the possibility of potentially getting rid of something
> at a later date.  I don't know if you want to use it here.  It only
> sometimes works.



--
Markus Lanthaler
@markuslanthaler