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

John Cowan <cowan@ccil.org> Fri, 31 May 2019 16:03 UTC

Return-Path: <cowan@ccil.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 70B6E1200FE for <json@ietfa.amsl.com>; Fri, 31 May 2019 09:03:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, 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 (2048-bit key) header.d=ccil-org.20150623.gappssmtp.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 ysHlvIPubO_o for <json@ietfa.amsl.com>; Fri, 31 May 2019 09:03:05 -0700 (PDT)
Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9859812013C for <json@ietf.org>; Fri, 31 May 2019 09:03:05 -0700 (PDT)
Received: by mail-oi1-x22c.google.com with SMTP id e189so1359706oib.11 for <json@ietf.org>; Fri, 31 May 2019 09:03:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DZXde8OmbyUmumCQF8Pj9Wh2Pj0T+/TMHZmq6uUk23o=; b=XFpTpD0nbIUO+Lc7mxnUDlR8z/2xW6N0rYP3YdxTrI8pjUe7m+1EmxLIAjYEQLllJs 68zuJCxpVDCTnP6tddgOowHnHpKqwy/8oCauygKaWsPMlhSsCQNE3MRfcccg/GO+ksrA 1QbacYU7gR/sHtD+1kMRS7PWO9/yD66N4OAMyAaov/UY+dQSwKCgTFWKCRHnqFGxziE7 ahd3HzgJ1qdT9YnpgI5ipdGs6g9islnNVimT2A9z+O1sVb/LYLqvEpRw0HZeA0O6Ve6l YM7S3u7W3oCwrGWAPlpY+45TxnerdV0j6GUJrD/qdCCfeipRsfKHUXgaY2Uh+NI+ErbQ kFGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DZXde8OmbyUmumCQF8Pj9Wh2Pj0T+/TMHZmq6uUk23o=; b=YqJ1PJ8N8ciV+ZvJR/Y10vq7LWwwySKe5DldWt7pR3pAZSFuoT8Y5DZOmPYQq7dJMh Vv+UUab5zTJOUPKPb9/2dvomPVMUxx2r+Iecb3QT1kVtvfy+UwJ/fcLymkMKdqVOKamg szREcoVaeBLaUbUqgPYB+fWl1M5eDIeJjI7MySsAo4XKwpi5D9Tw9iqu5wkjo8GSC8ci nT9v31VaXDVyJ9Vr1w/i+IIlpn169xD/0Q8IFyUh7LSABssbKAMVysXNk0VZfc5ojTqw WI445zBH2MyZIDhCCVyPt6GrNEQpt+ScrGuo18HPEeb6igwi2GqeiD6RmVMC5UmYn6l3 2b1w==
X-Gm-Message-State: APjAAAVR6AEekE4wiVVcXY3B5XcXTah06IVlKLZPWYzYo6xgdM5hHSLT X+uXSEdt2gKKR+/S8Aw5gg/aDHfPixwKtRgl7ZEBiA==
X-Google-Smtp-Source: APXvYqyJgNOn8MABFXZvAhKlnF3BHGuf2XjUT9q0ct9s0pIDYT9u2UUrJRht0dbjaI7KDcQfX3zutPg/gsfGsJ66A0w=
X-Received: by 2002:aca:de04:: with SMTP id v4mr6360410oig.162.1559318584749; Fri, 31 May 2019 09:03:04 -0700 (PDT)
MIME-Version: 1.0
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> <20190531035302.GF11773@localhost>
In-Reply-To: <20190531035302.GF11773@localhost>
From: John Cowan <cowan@ccil.org>
Date: Fri, 31 May 2019 12:02:54 -0400
Message-ID: <CAD2gp_S5z9Wpc6KbXJqqUvH8+y=fApY=b=XMes+5d8PEMTe3uQ@mail.gmail.com>
To: Nico Williams <nico@cryptonector.com>
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>
Content-Type: multipart/alternative; boundary="0000000000005605ae058a3126cf"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/Y4xUdVJYd8IcXEQLTd2BSxGiJTQ>
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 16:03:08 -0000

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.  It's a concession to the behavior of statically
typed
languages right back to Fortran ("God is real unless explicitly declared
integer").
Leaving that to inner layers means that everything has to be deserialized
into floats
and then deep-copied into objects whose fields are integers.

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.


John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
weirdo:    When is R7RS coming out?
Riastradh: As soon as the top is a beautiful golden brown and if you
stick a toothpick in it, the toothpick comes out dry.