Re: [Json] JSON Schema Language

Erik Wilde <erik.wilde@dret.net> Tue, 07 May 2019 21:29 UTC

Return-Path: <erik.wilde@dret.net>
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 E974012015D for <json@ietfa.amsl.com>; Tue, 7 May 2019 14:29:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 TTduUawK5pAF for <json@ietfa.amsl.com>; Tue, 7 May 2019 14:29:20 -0700 (PDT)
Received: from postoffice.gristmillmedia.com (dret.net [209.188.86.86]) (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 DED84120086 for <json@ietf.org>; Tue, 7 May 2019 14:29:19 -0700 (PDT)
Received: from 108-67-65-66.lightspeed.sntcca.sbcglobal.net ([108.67.65.66]:56798 helo=[192.168.1.78]) by postoffice.gristmillmedia.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from <erik.wilde@dret.net>) id 1hO7eG-00063R-6u; Tue, 07 May 2019 17:29:17 -0400
To: Austin Wright <aaa@bzfx.net>, Nico Williams <nico@cryptonector.com>
Cc: json@ietf.org, Tim Bray <tbray@textuality.com>, Anders Rundgren <anders.rundgren.net@gmail.com>
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>
From: Erik Wilde <erik.wilde@dret.net>
Message-ID: <69ea0c99-e983-5972-c0aa-824ddeecb7c4@dret.net>
Date: Tue, 07 May 2019 14:29:13 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <CEF72901-5077-4305-BA68-60624DCE952D@bzfx.net>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - postoffice.gristmillmedia.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - dret.net
X-Get-Message-Sender-Via: postoffice.gristmillmedia.com: authenticated_id: birdhouse@dret.net
X-Authenticated-Sender: postoffice.gristmillmedia.com: birdhouse@dret.net
X-Source:
X-Source-Args:
X-Source-Dir:
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/feG_d_04io63SKvWpiUOgZVF_GA>
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:29:23 -0000

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.

cheers,

dret.

-- 
erik wilde | mailto:erik.wilde@dret.net |
            | http://dret.net/netdret    |
            | http://twitter.com/dret    |