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

Nico Williams <nico@cryptonector.com> Fri, 31 May 2019 18:20 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 9741C12032F for <json@ietfa.amsl.com>; Fri, 31 May 2019 11:20:41 -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 lorIUu_CTXme for <json@ietfa.amsl.com>; Fri, 31 May 2019 11:20:38 -0700 (PDT)
Received: from lavender.maple.relay.mailchannels.net (lavender.maple.relay.mailchannels.net [23.83.214.99]) (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 4128C120328 for <json@ietf.org>; Fri, 31 May 2019 11:20:38 -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 493422C171E; Fri, 31 May 2019 18:20:37 +0000 (UTC)
Received: from pdx1-sub0-mail-a80.g.dreamhost.com (100-96-85-75.trex.outbound.svc.cluster.local [100.96.85.75]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DE0182C12F4; Fri, 31 May 2019 18:20:35 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
Received: from pdx1-sub0-mail-a80.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 18:20:37 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com
X-MailChannels-Auth-Id: dreamhost
X-Eight-Thoughtful: 1ac7aeff6db11438_1559326837117_1871183696
X-MC-Loop-Signature: 1559326837116:1737575236
X-MC-Ingress-Time: 1559326837116
Received: from pdx1-sub0-mail-a80.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a80.g.dreamhost.com (Postfix) with ESMTP id 115F9801C0; Fri, 31 May 2019 11:20:35 -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=mf7QdN33G5w3LN tfp2pNk2EZ0c8=; b=tLvy2qsVgvrkjs3tx/TgWz9YmDIO/M48ky4ilkCMKEeCz9 AmcY8mHpXDY34wxLwcU57SLv9qJUth971Kvk7GQE8yGVGEtW4PsNmW8AG5phzLqV cAWhlKD3b0XgigLhqMsu7XAzhyhdTkVZxiPSs+oujSfLJIEijANEAdgCLAkhg=
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-a80.g.dreamhost.com (Postfix) with ESMTPSA id 5416C801CF; Fri, 31 May 2019 11:20:32 -0700 (PDT)
Date: Fri, 31 May 2019 13:15:05 -0500
X-DH-BACKEND: pdx1-sub0-mail-a80
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: <20190531181504.GG11773@localhost>
References: <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> <20190531035302.GF11773@localhost> <CAD2gp_S5z9Wpc6KbXJqqUvH8+y=fApY=b=XMes+5d8PEMTe3uQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAD2gp_S5z9Wpc6KbXJqqUvH8+y=fApY=b=XMes+5d8PEMTe3uQ@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: gggruggvucftvghtrhhoucdtuddrgeduuddrudefuddguddvjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkfhggtggujggfsehttdertddtredvnecuhfhrohhmpefpihgtohcuhghilhhlihgrmhhsuceonhhitghosegtrhihphhtohhnvggtthhorhdrtghomheqnecukfhppedvgedrvdekrddutdekrddukeefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehlohgtrghlhhhoshhtpdhinhgvthepvdegrddvkedruddtkedrudekfedprhgvthhurhhnqdhprghthheppfhitghoucghihhllhhirghmshcuoehnihgtohestghrhihpthhonhgvtghtohhrrdgtohhmqedpmhgrihhlfhhrohhmpehnihgtohestghrhihpthhonhgvtghtohhrrdgtohhmpdhnrhgtphhtthhopehnihgtohestghrhihpthhonhgvtghtohhrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/FCm3YfW595SCkfIyOTrUDTC5wik>
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 18:20:42 -0000

On Fri, May 31, 2019 at 12:02:54PM -0400, John Cowan wrote:
> On Thu, May 30, 2019 at 11:57 PM Nico Williams <nico@cryptonector.com>
> wrote:
> > 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.
> 
> Okay, just one constraint.  [...]

:)

> > Conditional here means "may be present" vs "must be present".  That's
> > obviously necessary.
> 
> I don't mean that kind of conditional. I mean alternative, where an object
> value or array element can be of type "foo" or type "bar".  If that's not
> allowed (as it is not in my proposal), then recursive schemas can only
> be satisfied by infinitely large JSON values.

That's a union / discriminated union.  (CHOICE, in ASN.1.)

There's been nothing really new in this field since ASN.1...

XDR [RFC4506] is akin to a greatly simplified ASN.1, so it's much more
accessible and relevant to JSON.

Unfortunately XDR conflates "syntax" for specifying schema and "encoding
rules", and for JSON we only need "syntax" for specifying schema.  But
we could read RFC4506 for just the syntax and I think that might prove
useful here.

Nico
--