Re: [Json] JSON Schema Language: int53

"Manger, James" <James.H.Manger@team.telstra.com> Wed, 21 August 2019 04: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 7488B120106 for <json@ietfa.amsl.com>; Tue, 20 Aug 2019 21:56:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 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, URIBL_BLOCKED=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 c0NBFUKAGBcm for <json@ietfa.amsl.com>; Tue, 20 Aug 2019 21:56:33 -0700 (PDT)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) (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 DB014120071 for <json@ietf.org>; Tue, 20 Aug 2019 21:56:30 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.64,411,1559484000"; d="scan'208";a="322463255"
X-Amp-Result: SKIPPED(no attachment in message)
Received: from unknown (HELO ipcavi.tcif.telstra.com.au) ([10.97.217.200]) by ipobvi.tcif.telstra.com.au with ESMTP; 21 Aug 2019 14:56:06 +1000
Received: from wsmsg3754.srv.dir.telstra.com ([172.49.40.198]) by ipcavi.tcif.telstra.com.au with ESMTP; 21 Aug 2019 14:55:58 +1000
Received: from wsapp6785.srv.dir.telstra.com (10.75.3.134) by wsmsg3754.srv.dir.telstra.com (172.49.40.198) with Microsoft SMTP Server (TLS) id 8.3.485.1; Wed, 21 Aug 2019 14:54:56 +1000
Received: from wsapp5585.srv.dir.telstra.com (10.75.3.67) by wsapp6785.srv.dir.telstra.com (10.75.3.134) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 21 Aug 2019 14:54:55 +1000
Received: from AUS01-SY3-obe.outbound.protection.outlook.com (10.172.101.126) by wsapp5585.srv.dir.telstra.com (10.75.3.67) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Wed, 21 Aug 2019 14:54:55 +1000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EiJ+G89OTEHqhMkVT8xXzs0gxDgiJVUaKxq0lB8N34sQ4mxvK8c02FCqEAwg6xn1jatwkfmxVGLCjMZhJMqtWEGKUlpXeFd5LLqB9HeFCaXnUFULhO+oBO40vXfeaiWNCd4h2sN3ihrdwhGKFupL25fNNBEq9LHLFmhkhcW+obLpdEbXgeonjdZSW6HV8OKSrGk+jhhWWlJOZqBr3N3Wn7n7KFeQqAK8cXsf48k8ub7X8P4siUUgpI2gCU6jxs7DwUfttp2t1IUG6nfbIgLLTkVFyIehcjh8+xpRlF2ygXTRZhbAR5IL8JfQGVJPCSFS/MCTNfjaI8rGVdg2co9bcw==
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=vOaRsFN7dPLOop/8iCTTpm1HlxKIxH611Oko1fkwc44=; b=QceuCA/SgJcVgQT4ZH+UHe9bvhNRfRCHGsziAWQIKi6tyZD/6TaPyS2Ty94V7gRQBuo3ivVtBGfTArqinOeGDIXTu3jBfqrcGfg128roPmsMLLM62D8Wz2uemWP412BlW39tS7NvFxRRvOgULSIgAbTpc1CvfI4l0O4OTy0GjfngTaE9SC9pLN1M3Zkcf0O/FtdT3R6eEF0RRFSreIk/Wt1iqw7YvpNcOjD5CJvuvRtK3Fz+z7yDN7m0KhDfLDsKk6uA79NzpxWL08it571V0FG0zWgcCtDSRKJe6KEzU3s6yHBLBgzYaFCRHkkTQ25YFhdsyntrmpyvF7DMwkyLFw==
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=vOaRsFN7dPLOop/8iCTTpm1HlxKIxH611Oko1fkwc44=; b=aTUpEMCUGRgUWCiu27wfvkv/JFbrFm1BTYRxPz4XjXsO4tScLrF2zGIjizBTB30H0xhOmNiP5606jB+AcTlzKt/IPdn2WxU0r1YFXjlf5A4czCHn0RZK+VEwdpm+dPHl/o+djp/klDoD9vPUDbtvH/4m/prSTvaK/C+SRsYRET8=
Received: from SY2PR01MB2764.ausprd01.prod.outlook.com (52.134.190.138) by SY2PR01MB2412.ausprd01.prod.outlook.com (52.134.168.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Wed, 21 Aug 2019 04:54:54 +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.2178.018; Wed, 21 Aug 2019 04:54:54 +0000
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Ulysse Carion <ulysse@segment.com>
CC: JSON WG <json@ietf.org>
Thread-Topic: [Json] JSON Schema Language: int53
Thread-Index: AdVX3JGiH0dWYyhaRM2MmxjdYByFeQ==
Date: Wed, 21 Aug 2019 04:54:54 +0000
Message-ID: <SY2PR01MB2764698C2B0DE6811B9FDAFBE5AA0@SY2PR01MB2764.ausprd01.prod.outlook.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: 621182db-20d2-427a-abf7-08d725f3b545
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:SY2PR01MB2412;
x-ms-traffictypediagnostic: SY2PR01MB2412:
x-microsoft-antispam-prvs: <SY2PR01MB24126FCF2B6D035919EBEC7CE5AA0@SY2PR01MB2412.ausprd01.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8273;
x-forefront-prvs: 0136C1DDA4
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(396003)(39860400002)(346002)(136003)(366004)(376002)(13464003)(199004)(189003)(5024004)(14444005)(2906002)(66066001)(186003)(52536014)(8936002)(26005)(316002)(476003)(81166006)(7736002)(305945005)(5660300002)(74316002)(8676002)(81156014)(486006)(102836004)(53546011)(7696005)(6506007)(9686003)(71200400001)(478600001)(71190400001)(4326008)(229853002)(76116006)(6116002)(14454004)(99286004)(55016002)(33656002)(6246003)(6436002)(86362001)(3846002)(6916009)(66446008)(66476007)(64756008)(66946007)(66556008)(256004)(25786009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:SY2PR01MB2412; H:SY2PR01MB2764.ausprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:1;
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: 1v9ophRtUj2Vpe4b06rI+326l/kJ68HAYnKHGPEyT3wGvxagznj5bcDLUFo6//dYcSWiVUvVI5aM7z9ZN00jSSBq02lOwj3aTyl6G7K/lz/LFzEbatV7ZX7ToUkQQSodAbblpWlECD+NOcKZxBfKkYvxkdgtOp83Qukzczbg02iZcdn26DofkETaYkGcuKEbTVxLFVzz+1+NMaz2u8Q96z3kua7Ax18I7ZxcmsauHxveEqXgeEKpVmpvmIm8F40l2vwTowvQbFLolL5V2p5QeoNvvgWTlUVMkv2G1WiyepTvuyUk6CtpgiObVnPmlhM8AjN5m/KfoFMdiRetP0UuC8j+j+NhsEOK1wJfTAATO6nm81/fNcHrr7lK5HCijx6FvvLJZ8g1DFhfp6PCPjZAussQyXqgPLCMyNZuC6EyuyE=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 621182db-20d2-427a-abf7-08d725f3b545
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2019 04:54:54.3328 (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: 7CA/6QcA8B582rPDQZVylwB5KnvtwnSsjdAIPsWnBhL6pAWOhivDBQ3MG9sjS88LRSCwtGjDBrL0jQML6oU/vdjbrapIVeWP+0tTd8ehdhA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY2PR01MB2412
X-OriginatorOrg: team.telstra.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/Bf2xaQgZqnqvOfiJpCowwcHwtrY>
Subject: Re: [Json] JSON Schema Language: 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, 21 Aug 2019 04:56:36 -0000

Surely int53 is fine for code generation. When you see int53 in a schema, generate a field of type long (in Java).
That alone will not enforce a 2^53 limit, but so what.

When a schema has:
  "numberOfSiblings": "int8"
  "dayOfWeek" : "int8"
It doesn't mean that 120 is a sensible number of brothers & sisters, or -55 can be a day of the week. It just means that the valid values for these fields can be represented with the range offered by int8. Apps still need to do their own validation beyond that.

If you omit int53, then your code generation will never create a long despite this being a widely available & useful type.

--
James Manger

-----Original Message-----
From: json <json-bounces@ietf.org> On Behalf Of Ulysse Carion
Sent: Wednesday, 21 August 2019 5:06 AM
To: Richard Gibson <richard.gibson@gmail.com>
Cc: Carsten Bormann <cabo@tzi.org>; Pete Cordell <petejson@codalogic.com>; JSON WG <json@ietf.org>
Subject: Re: [Json] JSON Schema Language: extensibility and unspecified properties

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

> IMO, the schema should be about representing what the protocol needs
> rather than how it is represented on a target machine.

This is a reasonable stance. But I don't think it's what I'm trying to
solve for. My focus has continually been on code generation from
schemas; the spec's expressive power is intentionally limited
specifically to enable code generation. Optimizing for code generation
is why I *am* concerning myself with how things are represented on
target machines.

There are lots of good options for schemas languages that are focused
on being as expressive as protocols are complex -- you've written one
of these good options, Pete -- but I've been concerned with making a
schema language as inexpressive as mainstream type systems are simple.

I'm not debating whether there are ways of representing int53 in many
languages. My objection is that I would be making up a type that
doesn't exist in existing programming languages natively or
idiomatically. If someone wants to do int53 bounds checks, they can
always use the float64 type, and then do bounds checking after schema
validation. Or they can write an extension.