Re: [Json] JSON Schema Language

Phillip Hallam-Baker <ietf@hallambaker.com> Tue, 07 May 2019 21:48 UTC

Return-Path: <hallam@gmail.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 640751200EF for <json@ietfa.amsl.com>; Tue, 7 May 2019 14:48:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.668
X-Spam-Level:
X-Spam-Status: No, score=-1.668 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
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 DoAe7PYbOKEo for <json@ietfa.amsl.com>; Tue, 7 May 2019 14:48:57 -0700 (PDT)
Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 456791200EB for <json@ietf.org>; Tue, 7 May 2019 14:48:57 -0700 (PDT)
Received: by mail-ot1-f47.google.com with SMTP id f23so16444353otl.9 for <json@ietf.org>; Tue, 07 May 2019 14:48:57 -0700 (PDT)
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=wpaX950sW93x59I+rmO6Iw+cS4tnObELp8en6MkC7jA=; b=KaFYiKi+098V53Dzb+65/PUpnKt+dVNGruH9yunZEmCH4WQxVnCKxpqLP/b7bU7Cp2 L8+7AIdWP3fS23N0FiSVnsvlxTuTSZ70edUeNEI6fe41kKqKGJjjaq2AZd446srdedSy f7JamCsTQzp1dqw9tecXXwZhFBJouEnQucaR/NHnqcj3P9habQyF1BPUZE6uez3Lh/gP wubxUq2vo3ATGoem4xvTRIZTosErSVLFGqi9nmhLQdvFUH3McmBICQsK08kAcOk6fn8c nnxcXAksMtM9rb0YAOAgGZeNnBRgu6IUJ36JRjhsJVhjLPi5AidrpJ+D8npbQMwClKa0 QdSA==
X-Gm-Message-State: APjAAAWjkXS4Xck/ZAgDxzTZuutGyKYwKsCCPms+ozlag45zPvnjPkzV X/s2/wvwbV9c/HG7E2EghqJG/eKho/5Jwzq6KJ0=
X-Google-Smtp-Source: APXvYqykQw1y0dUtvpVeLUqTt4NOxwvWkl9G7aa6G1oUQn5YofKG+MSr5LuLrmIjvy06HNn0Ummrtc/AaTutoIh6H/0=
X-Received: by 2002:a9d:e8c:: with SMTP id 12mr24601867otj.120.1557265736369; Tue, 07 May 2019 14:48:56 -0700 (PDT)
MIME-Version: 1.0
References: <CAJK=1RjV1uv0eOdtFZ8cKn-FfCwCiGP5r2hOz1UamiM6YV4H1A@mail.gmail.com> <CAHBU6itE8kub1qtdRoW8BqxaOmzMv=vUo1aDeuAr3HX141NUGg@mail.gmail.com> <77994bdb-a400-be90-5893-b846a8e13899@gmail.com> <20190507154201.GP21049@localhost> <CEF72901-5077-4305-BA68-60624DCE952D@bzfx.net> <69ea0c99-e983-5972-c0aa-824ddeecb7c4@dret.net>
In-Reply-To: <69ea0c99-e983-5972-c0aa-824ddeecb7c4@dret.net>
From: Phillip Hallam-Baker <ietf@hallambaker.com>
Date: Tue, 07 May 2019 17:48:46 -0400
Message-ID: <CAMm+LwjyVjnJuWE4+a9Ea=_X1uuEGuK+O4KojzN3uVQ+s+HqUQ@mail.gmail.com>
To: Erik Wilde <erik.wilde@dret.net>
Cc: Austin Wright <aaa@bzfx.net>, Nico Williams <nico@cryptonector.com>, Anders Rundgren <anders.rundgren.net@gmail.com>, Tim Bray <tbray@textuality.com>, JSON WG <json@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000098adf0588532f57"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/QW5kV1yugMTB8AG47m1X-8TqNV0>
Subject: Re: [Json] JSON Schema 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: Tue, 07 May 2019 21:48:59 -0000

On Tue, May 7, 2019 at 5:29 PM Erik Wilde <erik.wilde@dret.net> wrote:

> On 2019-05-07 14:13, Austin Wright wrote:
> > I would put it slightly differently: While JSON doesn’t define any
> concept of an “integer”, applications that encode integers (e.g. uint32_t
> or similar) might conceivably emit it with the "frac” production (using a
> trailing decimal and zero); this is not ambiguous, and in the interest of
> being liberal in what you accept, parsers shouldn’t produce any error.
>
> at the risk of referring to XSD too much, but i think they got it right:
>
> - constraining facets for constraining the value space.
> - lexical facets for constraining the representation of values.
>
> maybe JSON schema languages do not want to copy that exact model, but
> the general design approach might be helpful to look at.
>

I disagree on the constraining facets part. The only values I have found
useful to put in a schema are 0 or 1 minimum occurrences and 1 or infinity
maximum occurrences.

I don't have these constraints in any programming language I have used
since I did formal methods 25 years ago. The only ones that did were Z and
VDM.