Re: [Json] JSON Schema Language is nearly done: int53

"Manger, James" <James.H.Manger@team.telstra.com> Wed, 31 July 2019 06:56 UTC

Return-Path: <James.H.Manger@team.telstra.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 C2AAB12004E for <json@ietfa.amsl.com>; Tue, 30 Jul 2019 23:56:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=team.telstra.com
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 T3KBSh_bc5X7 for <json@ietfa.amsl.com>; Tue, 30 Jul 2019 23:56:20 -0700 (PDT)
Received: from ipxavo.tcif.telstra.com.au (ipxavo.tcif.telstra.com.au [203.35.135.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CE38C12001B for <json@ietf.org>; Tue, 30 Jul 2019 23:56:19 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.64,329,1559484000"; d="scan'208";a="318003444"
X-Amp-Result: SKIPPED(no attachment in message)
Received: from unknown (HELO ipcbvi.tcif.telstra.com.au) ([10.97.217.204]) by ipoavi.tcif.telstra.com.au with ESMTP; 31 Jul 2019 16:56:16 +1000
Received: from wsmsg3756.srv.dir.telstra.com ([172.49.40.84]) by ipcbvi.tcif.telstra.com.au with ESMTP; 31 Jul 2019 16:56:16 +1000
Received: from wsapp5585.srv.dir.telstra.com (10.75.3.67) by wsmsg3756.srv.dir.telstra.com (172.49.40.84) with Microsoft SMTP Server (TLS) id 8.3.485.1; Wed, 31 Jul 2019 16:56:16 +1000
Received: from wsapp5584.srv.dir.telstra.com (10.75.131.20) by wsapp5585.srv.dir.telstra.com (10.75.3.67) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 31 Jul 2019 16:56:14 +1000
Received: from AUS01-SY3-obe.outbound.protection.outlook.com (10.172.229.126) by wsapp5584.srv.dir.telstra.com (10.75.131.20) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Wed, 31 Jul 2019 16:56:14 +1000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Okb7uXrOGoQEu9IYVpOHe9OGzFBvSlR5HIoO5YX+Ifcg+cNWmCjl4LKCPK1T2qgAhv3dBmz1SdrBenR9dZ410O491KlcVe7CaoWdjUFsOTMp61pTr+cjGw3beKpq8nRiVXlsmTYA2DyvG4aXTEAv3Rsjg4k3U2Zxp8/x+w9ZIHg+rb5lDIcS4NQWLFPWnP2+L2FG574lEbb0XCNNULJrd838k3gNRUm4105Ud9tH2ZsnfCqPrb/Zkx4US8P+iErhULRs+fCoILUUZRsCPMLAwYWKWJqyKRZA5ymUSDi16Zq1tkb3D64N7XwtBFzOxxJzL6KNW17udSUdpODnmzcJCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xodUCwWREBrnWXnat/mWdNt2z0EQMPzoTyAb9KlTBBE=; b=lwWj04HxCVqYZPb3NwNrq8k0ofXqKzL0YOkKzwk6D+QfEP9T8cy7GMa4pNzHWSAWZn2t3OwGVFjFTUjLXP1w7tLSoGbR9UfrzVECMmWZGDBRq57uAz0ybSioXFbMJjVZ6wN5qBEbJJ2Nr5f+Gff18SQEIidvQd47xEp5LRsp9wu4pdKYdCecIS2jv/XHdvcXW4C8ieVVcCheHYRCVtR0I3H6JJmYWtcuNqyHhr88iH0y6Lx3sjsRdaRvoVoDYPnTSVqLhzNV4oRGs3c9DSlgA+zqnyV+h2taAz8WHutidCB2MpLD4ifmEdQkZJArLwEPMa5cxCKcviOJgUcBfO4rnw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=team.telstra.com;dmarc=pass action=none header.from=team.telstra.com;dkim=pass header.d=team.telstra.com;arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=team.telstra.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xodUCwWREBrnWXnat/mWdNt2z0EQMPzoTyAb9KlTBBE=; b=mH1mJ9ExWTHrJh2KSPmc13bIrVJL2NcYwPiapcDuSmG4pbq5i8qPgtev48dOEmrjmTB/CPXHnHD/DyUuvsmikpjDtYbSjQXKcgVLgFiXf51yTojGQwfYusFF/g2QxlHBzLgHXDsS5grTuFWDBVqSVhy5iynDZ6XabWxMzUyOv1M=
Received: from SY2PR01MB2764.ausprd01.prod.outlook.com (52.134.190.138) by SY2PR01MB2825.ausprd01.prod.outlook.com (52.134.187.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.15; Wed, 31 Jul 2019 06:56:13 +0000
Received: from SY2PR01MB2764.ausprd01.prod.outlook.com ([fe80::a080:9084:3e2f:68ab]) by SY2PR01MB2764.ausprd01.prod.outlook.com ([fe80::a080:9084:3e2f:68ab%4]) with mapi id 15.20.2115.005; Wed, 31 Jul 2019 06:56:13 +0000
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>, JSON WG <json@ietf.org>
Thread-Topic: [Json] JSON Schema Language is nearly done: int53
Thread-Index: AdVFqS7zAUo6y82iShaTcwTHe50WbAA41YoAAAAx+iAAM/kxgAABR4mQ
Date: Wed, 31 Jul 2019 06:56:13 +0000
Message-ID: <SY2PR01MB2764600E16BA7A19025964EFE5DF0@SY2PR01MB2764.ausprd01.prod.outlook.com>
References: <SY2PR01MB27642C6983E387C397B11581E5DD0@SY2PR01MB2764.ausprd01.prod.outlook.com> <CAJK=1RjhuCYJe4-BSB++8+-dHG3LV8TdqsnFEPAoAkfJ1mOE3A@mail.gmail.com> <SY2PR01MB2764AD4523625006B1F3DFEBE5DC0@SY2PR01MB2764.ausprd01.prod.outlook.com> <aeb4dfcc-4227-2d8e-d1dc-914d078450fe@gmail.com>
In-Reply-To: <aeb4dfcc-4227-2d8e-d1dc-914d078450fe@gmail.com>
Accept-Language: en-AU, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
dlp-product: dlpe-windows
dlp-version: 11.1.100.23
dlp-reaction: no-action
authentication-results: spf=none (sender IP is ) smtp.mailfrom=James.H.Manger@team.telstra.com;
x-originating-ip: [203.41.142.253]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: aa441f87-54d7-4299-9547-08d715842d40
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:SY2PR01MB2825;
x-ms-traffictypediagnostic: SY2PR01MB2825:
x-microsoft-antispam-prvs: <SY2PR01MB28252387CA22F30AEA9F0D4BE5DF0@SY2PR01MB2825.ausprd01.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 011579F31F
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(346002)(376002)(366004)(396003)(136003)(189003)(199004)(102836004)(52536014)(66556008)(86362001)(66476007)(6116002)(71190400001)(5660300002)(6506007)(76116006)(25786009)(7696005)(64756008)(66066001)(486006)(55016002)(99286004)(305945005)(66446008)(71200400001)(9686003)(186003)(76176011)(110136005)(3846002)(6246003)(66946007)(229853002)(74316002)(11346002)(81166006)(6436002)(68736007)(14454004)(2906002)(8676002)(26005)(316002)(33656002)(256004)(53936002)(8936002)(446003)(81156014)(478600001)(7736002)(476003); DIR:OUT; SFP:1102; SCL:1; SRVR:SY2PR01MB2825; H:SY2PR01MB2764.ausprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0;
received-spf: None (protection.outlook.com: team.telstra.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: l541G7GVKjeZ4s57Ifd1fFHtBKKxDg0Q99Xhtu6TXJnZvLotXTiRMD0DHOu44eoUkZK3EZlPlIL/BZNZLZKdAkTMv5i8W+9sd+vxOiH+CI0yg9W2TwOPeUr/A4JvyNL2ukEP2X6edxhR4nofgZUjnhca6o15pSrVc9KnHNrinz/lIVcKzAvzRTxMIgZ2nkt+5iVnnxPAImwQRwkCEf8obS17obkD3y0MEXrS05O72+1VA/oqPIF2+3Zd04qH3sJEp7JRPFUzhfAjyPw4UzLm3efKzuS204IumtaT9/5y9EEdQIbarT7y9Lx8vRKNJxnC19r6/TqJMDs5RYpyqXt40mKPcINrlQSZB8C+m83BVlVQ+HnY84JiqT4xVbJCmEfFWtB2nOkYWn6fsvnzdLv7Zw/q2+LuWkybnP8nXP5lcoU=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: aa441f87-54d7-4299-9547-08d715842d40
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2019 06:56:13.2299 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 49dfc6a3-5fb7-49f4-adea-c54e725bb854
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: James.H.Manger@team.telstra.com
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY2PR01MB2825
X-OriginatorOrg: team.telstra.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/qMAN8H6f3bmGITWgmOzihGGadPo>
Subject: Re: [Json] JSON Schema Language is nearly done: int53
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: Wed, 31 Jul 2019 06:56:24 -0000

> Dropping int64 is hardly an option, neither is BigInteger.   int53 is a special that for example fits UNIX "epoch".

Dropping int64 or BigInteger from *programming languages* is not an option. But dropping the ability for a JSON schema to suggest that arbitrary values of those types should be serialized to JSON numbers would be sensible.

> Arbitrarily sized integers are used by tons of applications based on JSON messaging and is available for most platforms including JS.

Sure, but they are not serialized to a JSON number. They are serialized to a JSON string of some form (eg "65537.00" or "AQAB").

> That there are multiple ways of formatting integers in JSON is unfortunately a reality all JSON tool maker must (in some way) address.

Are you referring to 123, 123.0, 12.3E+1 and 1.23e2 as the multiple ways? Or 123, "123", "123.00", and "ew==" as the multiple ways?

> I would reverse the integer syntax and claim that integers SHOULD conform to standard integer (not JSON) syntax since a standard should not break the multitude of JSON tools that already implement this.

It sounds like you want JSON serializers to never use the fraction or exponent notations when a schema says a field is an integer. That's adding a distinction that doesn't exist in JSON so it will break things. A tool parsing JSON *without knowing the schema* may well use a double for a number, which it may then serialize in exponent notation even if it is an integer. For instance, in Java Double.toString(123000000) returns "1.23E8".
Mind you, I suspect 1.23E8 will break many implementations that expect an integer so perhaps we should require the no-fraction-no-exponent form.

This is a separate issue to this thread, however, which was whether a JSON schema should offer "int53" as a type, and if it should offer "{u}int{8|16|32}" as types.

--
James Manger