Re: [Json] JSON Schema Language

Carsten Bormann <cabo@tzi.org> Wed, 08 May 2019 04:43 UTC

Return-Path: <cabo@tzi.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 613BE120125 for <json@ietfa.amsl.com>; Tue, 7 May 2019 21:43:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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 IDu2qPM-dq8h for <json@ietfa.amsl.com>; Tue, 7 May 2019 21:43:55 -0700 (PDT)
Received: from smtp.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A5C59120052 for <json@ietf.org>; Tue, 7 May 2019 21:43:55 -0700 (PDT)
Received: from [192.168.217.106] (p54A6CC75.dip0.t-ipconnect.de [84.166.204.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 44zP4n3Yy4zyZf; Wed, 8 May 2019 06:43:53 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CAJK=1Rj7PBD-bbwvsqgjQQzp4Aoidb-W2q5Lj6asMHHDHaTVYQ@mail.gmail.com>
Date: Wed, 08 May 2019 06:43:52 +0200
Cc: JSON WG <json@ietf.org>
X-Mao-Original-Outgoing-Id: 578983430.893343-302d029010ca245cbcaa6fb329711992
Content-Transfer-Encoding: quoted-printable
Message-Id: <D1F5C99C-ACD9-41C3-A484-54191C9386D9@tzi.org>
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> <CAMm+LwjyVjnJuWE4+a9Ea=_X1uuEGuK+O4KojzN3uVQ+s+HqUQ@mail.gmail.com> <058f58a3-dd27-998e-5f54-4874aff5f2f0@dret.net> <20190507221726.GR21049@localhost> <CAJK=1Rj7PBD-bbwvsqgjQQzp4Aoidb-W2q5Lj6asMHHDHaTVYQ@mail.gmail.com>
To: Ulysse Carion <ulysse@segment.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/2eLoacsE9_VDMBYFRihvHv9NVRU>
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: Wed, 08 May 2019 04:43:58 -0000

On May 8, 2019, at 01:57, Ulysse Carion <ulysse@segment.com> wrote:
> 
> Are we in agreement that the question of describing JSON,

Certainly.
Describing protocols that are based on JSON benefits from a notation for describing the JSON data items to be interchanged.
So like we have ABNF for protocols based on text (there are only very few people who would argue that ABNF is not useful — yes, I have met them, but I don’t agree with them), we have CDDL for protocols based on the JSON data model (as realized in CBOR or JSON).  See

https://datatracker.ietf.org/doc/draft-ietf-cbor-cddl/referencedby/
and
https://datatracker.ietf.org/doc/draft-greevenbosch-appsawg-cbor-cddl/referencedby/

for some 30 IETF documents referencing the approved CDDL specification or a previous version of it (CDDL has been essentially stable since March 2015 and was finally approved in March 2019); CDDL is also being used in other SDOs that define JSON-/CBOR-encoded protocols.

> and from
> that description generating validators and idiomatic
> classes/types/etc, is a problem worth solving?

Well, we probably have different ideas on the specific contexts in which “validation” and code generators become useful.  (With ABNF, there is a whole spectrum of “specification only” usage up to parser generators that can read ABNF.)  But having a notation for the structures that the protocol provides is a first step that is needed whenever validators and code generators are useful, which they sometimes are.  Other useful tools that benefit from a description notation include example instance generators and pretty printers.

Comparing JSON-based tools with XML-based ones, CDDL is probably closest to Relax-NG (ISO/IEC 19757-2).  There are other approaches for describing data, e.g., Schematron (ISO/IEC 19757-3) for XML; I would expect we will grow those approaches in conjunction with  what we already have.

Grüße, Carsten