Re: [Json] A minimal examplotron-style JSON validation language.

Nico Williams <nico@cryptonector.com> Fri, 31 May 2019 03:57 UTC

Return-Path: <nico@cryptonector.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 0709E120025 for <json@ietfa.amsl.com>; Thu, 30 May 2019 20:57:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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_NONE=-0.0001, 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=cryptonector.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 WPtzfbkfnCl1 for <json@ietfa.amsl.com>; Thu, 30 May 2019 20:57:35 -0700 (PDT)
Received: from goldenrod.birch.relay.mailchannels.net (goldenrod.birch.relay.mailchannels.net [23.83.209.74]) (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 F1426120019 for <json@ietf.org>; Thu, 30 May 2019 20:57:34 -0700 (PDT)
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 610658C2397; Fri, 31 May 2019 03:57:33 +0000 (UTC)
Received: from pdx1-sub0-mail-a41.g.dreamhost.com (100-96-89-88.trex.outbound.svc.cluster.local [100.96.89.88]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id F08618C22D8; Fri, 31 May 2019 03:57:29 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
Received: from pdx1-sub0-mail-a41.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Fri, 31 May 2019 03:57:33 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com
X-MailChannels-Auth-Id: dreamhost
X-Trouble-Shelf: 45986add2a8db1b7_1559275053228_109809081
X-MC-Loop-Signature: 1559275053227:4121499219
X-MC-Ingress-Time: 1559275053227
Received: from pdx1-sub0-mail-a41.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a41.g.dreamhost.com (Postfix) with ESMTP id AD3AF8002E; Thu, 30 May 2019 20:57:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=Fejz47QlmZAlrd uc1U3GyJsYplg=; b=Hddh3mD7vcJvcfVp9TgyWVaU8ixj14K+bNTxGK0ctnTHmn AZcFElziqfHjGScni0c0AuTrEpUiojzsxuUtQdXy+N7lEv2U/ja1nhiSwoo0pvA7 rwZUUMF2MRJvtqoaoFYxMaEnIQbEQkpeINu/CWzMFza87bTYxkxOsDI4LYryg=
Received: from localhost (unknown [24.28.108.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a41.g.dreamhost.com (Postfix) with ESMTPSA id 465E98002C; Thu, 30 May 2019 20:57:22 -0700 (PDT)
Date: Thu, 30 May 2019 22:53:03 -0500
X-DH-BACKEND: pdx1-sub0-mail-a41
From: Nico Williams <nico@cryptonector.com>
To: John Cowan <cowan@ccil.org>
Cc: Tim Bray <tbray@textuality.com>, JSON WG <json@ietf.org>, Carsten Bormann <cabo@tzi.org>, Ulysse Carion <ulysse@segment.com>, Rob Sayre <sayrer@gmail.com>
Message-ID: <20190531035302.GF11773@localhost>
References: <CAChr6SwNvG4Z7TKUxAVeH7HMVWiPsEBNb12K9zVkjaGt2_v0fw@mail.gmail.com> <CAHBU6ivTD_v7L-wQ+P9TmSfBY=5N+k-caaZ0TZhg6yZ_SWR_aA@mail.gmail.com> <CAChr6SzD8qdETafQKKU41BcYayTWf+C4GENd9FNzy5JYOv5jRQ@mail.gmail.com> <CAHBU6isx5aB94U-vn_t6GGoQ9W+ATDNYR6_+CtXgOhFho5Qh-g@mail.gmail.com> <20190529144005.GC11773@localhost> <CAD2gp_QELt-3=wqA1gRafNim8Y6fsxZ6hcQmTsoOxCSxU8eM1Q@mail.gmail.com> <20190529201716.GD11773@localhost> <CAD2gp_RmOgea63LeVr36=++nkALa34cvqHbMKXqR7HyzEioBcg@mail.gmail.com> <20190530181650.GE11773@localhost> <CAD2gp_Q2X-JvSYjy+=wU8FDaxAyZ7qGZ5DyU76vJ29T0C_TXtw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAD2gp_Q2X-JvSYjy+=wU8FDaxAyZ7qGZ5DyU76vJ29T0C_TXtw@mail.gmail.com>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: -100
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudeftddgjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfhfgggtuggjfgesthdtredttdervdenucfhrhhomheppfhitghoucghihhllhhirghmshcuoehnihgtohestghrhihpthhonhgvtghtohhrrdgtohhmqeenucfkphepvdegrddvkedruddtkedrudekfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghloheplhhotggrlhhhohhsthdpihhnvghtpedvgedrvdekrddutdekrddukeefpdhrvghtuhhrnhdqphgrthhhpefpihgtohcuhghilhhlihgrmhhsuceonhhitghosegtrhihphhtohhnvggtthhorhdrtghomheqpdhmrghilhhfrhhomhepnhhitghosegtrhihphhtohhnvggtthhorhdrtghomhdpnhhrtghpthhtohepnhhitghosegtrhihphhtohhnvggtthhorhdrtghomhenucevlhhushhtvghrufhiiigvpedt
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/hEjGU7sTZt4ju_1lhWjIBafSqEg>
Subject: Re: [Json] A minimal examplotron-style JSON validation 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: Fri, 31 May 2019 03:57:37 -0000

On Thu, May 30, 2019 at 11:53:48PM -0400, John Cowan wrote:
> On Thu, May 30, 2019 at 2:28 PM Nico Williams <nico@cryptonector.com> wrote:
> > You start with what you need and add new constraints as you discover
> > they would be useful.
> 
> Okay, I'm proposing starting with *no* scalar constraints, only constraints
> on the types of array elements and object elements.

I can live with that.

> > Again, if we have consensus for such a contraint, we should include it,
> > and if not, not.
> 
> It's needed because essentially all statically typed languages treat ints
> and floats as disjoint types.  That's not a good thing, but we are stuck
> with it de facto.

JSON doesn't distinguish between "ints" and "floats", so if you want
that distinction then you're asking for constraints on the numeric
scalar type.

> > The point about defining types is that you can express recursive
> > nesting, which is harder to do with by-example schemas.
> 
> Without conditional types, there can be no finite recursion.

Conditional here means "may be present" vs "must be present".  That's
obviously necessary.

Nico
--