Re: [Json] Adding integers to JSON (Re: JSON Schema Language)

Carsten Bormann <cabo@tzi.org> Thu, 09 May 2019 06:50 UTC

Return-Path: <cabo@tzi.org>
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 B5BD41200F5 for <json@ietfa.amsl.com>; Wed, 8 May 2019 23:50:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9s8asCH1_yNU for <json@ietfa.amsl.com>; Wed, 8 May 2019 23:50:30 -0700 (PDT)
Received: from smtp.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2DFD5120049 for <json@ietf.org>; Wed, 8 May 2019 23:50:30 -0700 (PDT)
Received: from [192.168.217.106] (p54A6CC75.dip0.t-ipconnect.de [84.166.204.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 4503rM688dzyTX; Thu, 9 May 2019 08:50:27 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <02755092-1682-45E8-AB6C-0EDA7D35703A@bzfx.net>
Date: Thu, 09 May 2019 08:50:27 +0200
Cc: JSON WG <json@ietf.org>
X-Mao-Original-Outgoing-Id: 579077424.814926-716de49591f48f9e1412b5ca17e8a639
Content-Transfer-Encoding: quoted-printable
Message-Id: <B7EA86E6-A9F3-45FE-8436-2F36812C615B@tzi.org>
References: <CAHBU6itE8kub1qtdRoW8BqxaOmzMv=vUo1aDeuAr3HX141NUGg@mail.gmail.com> <77994bdb-a400-be90-5893-b846a8e13899@gmail.com> <20190507154201.GP21049@localhost> <CEF72901-5077-4305-BA68-60624DCE952D@bzfx.net> <69ea0c99-e983-5972-c0aa-824ddeecb7c4@dret.net> <CAMm+LwjyVjnJuWE4+a9Ea=_X1uuEGuK+O4KojzN3uVQ+s+HqUQ@mail.gmail.com> <058f58a3-dd27-998e-5f54-4874aff5f2f0@dret.net> <20190507221726.GR21049@localhost> <CAJK=1Rj7PBD-bbwvsqgjQQzp4Aoidb-W2q5Lj6asMHHDHaTVYQ@mail.gmail.com> <702ee54b-9465-7ca8-b521-2a88c1a47785@gmail.com> <20190508160740.GU21049@localhost> <ACD9A0A2-A75E-4B6E-9E9B-165DC222781B@tzi.org> <02755092-1682-45E8-AB6C-0EDA7D35703A@bzfx.net>
To: Austin Wright <aaa@bzfx.net>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/EBb-LH37LQiGJyVndDLzgSp7JeU>
Subject: Re: [Json] Adding integers to JSON (Re: JSON Schema Language)
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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, 09 May 2019 06:50:33 -0000

On May 9, 2019, at 00:49, Austin Wright <aaa@bzfx.net> wrote:
> 
>> Now people did not want to accept that.
>> They wanted to extend the JSON data model with the distinction between two number types.
> 
> Who’s “they”?

Those people who want 3 and 3.0 to mean different things in a JSON document.

> Neither of these “extend" JSON, because JSON does not impose any requirements on how implementations parse numbers. My reading of RFC8259 allows implementations to differentiate between `3` vs `3.0` vs `3.00`.

The language that Section 6 of RFC 8259 has inherited is not very good.
I cannot achieve a reading, though, that would support the above.

>> — duplicate map keys for adding comments to JSON.  Some people believe:
>> 
>> { “postcode”: “This is a comment about the post code 4711”,
>>   “postcode”: 4711 }
>> 
>> is a valid way to extend JSON with comments.  (Because their implementation happens to ignore map keys that are invalidly used again later, which is not a given.)
> 
> Certainly, this is not interoperable. But it is legal: RFC8259 merely says documents “SHOULD NOT” use multiple keys,

Please re-read RFC 2119.  SHOULD is a normative statement.  It is not a MUST mainly because streaming implementations would have a hard time properly implementing that prohibition, so they are allowed to occasionally malfunction.  But a malfunction it is.

> and allows different implementations to handle it differently. ECMA-404 specifically says there’s no limits on string names, even repeated names (ECMA 404 is the document referenced by ECMAScript, though that specifies an algorithm that ignores repeated keys.)

Well, yeah.  There is a reason we needed to maintain an IETF specification here.

>> - unnecessary escaping for ascribing some special semantics.  Say, if a string starts with “\u0073” and not with the equivalent “s”, this is supposed to mean the string has some different semantics (e.g., the rest is a base64url encoded byte string as opposed to what would normally be a text string, or a type tag, or…).
> 
> While JSON strongly implies these two forms must be considered the same thing, note this isn’t true for all formats. Namely, %2F is not the same as a forward slash in a URI, they are to be treated differently. (There’s been many security holes caused because people treat `%2F..%2F` the same as `/../` and it’s not.)

I was talking about JSON, not about URIs, where percent notation indeed has different semantics (essentially creating a double of the encoded character without its syntactic properties).

The myths and misunderstandings cited in this message are actually a good corollary to the discussion of the Postel principle and soupification that is happening over at ietf@ietf.org…  The JSON WG historically has shied away from making some of its statements very clear, and the resultant weasel wording will come back forever biting us.  I hope we can be better in the future.

Grüße, Carsten