Re: [Json] JSON Schema Language

Pete Cordell <petejson@codalogic.com> Tue, 07 May 2019 16:15 UTC

Return-Path: <petejson@codalogic.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 344B512018B for <json@ietfa.amsl.com>; Tue, 7 May 2019 09:15:27 -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, RCVD_IN_DNSWL_NONE=-0.0001, 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 Zz1qEVbLcBAB for <json@ietfa.amsl.com>; Tue, 7 May 2019 09:15:24 -0700 (PDT)
Received: from ppsa-online.com (ppsa-online.com [217.199.162.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0F3E5120144 for <json@ietf.org>; Tue, 7 May 2019 09:15:23 -0700 (PDT)
Received: (qmail 14283 invoked from network); 7 May 2019 17:13:31 +0100
Received: from host109-157-169-192.range109-157.btcentralplus.com (HELO ?192.168.1.72?) (109.157.169.192) by lvps217-199-162-217.vps.webfusion.co.uk with ESMTPSA (AES128-SHA encrypted, authenticated); 7 May 2019 17:13:30 +0100
To: Tim Bray <tbray@textuality.com>, Ulysse Carion <ulysse@segment.com>
Cc: json@ietf.org
References: <CAJK=1RjV1uv0eOdtFZ8cKn-FfCwCiGP5r2hOz1UamiM6YV4H1A@mail.gmail.com> <CAHBU6itE8kub1qtdRoW8BqxaOmzMv=vUo1aDeuAr3HX141NUGg@mail.gmail.com>
From: Pete Cordell <petejson@codalogic.com>
Message-ID: <cfcdd163-36d0-8b98-5f34-84c3e5e774ad@codalogic.com>
Date: Tue, 07 May 2019 17:15:18 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <CAHBU6itE8kub1qtdRoW8BqxaOmzMv=vUo1aDeuAr3HX141NUGg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-GB
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/hLoyNnYObmTRVLGz9mmRaf0VcuA>
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 16:15:27 -0000

On 06/05/2019 23:38, Tim Bray wrote:
> Hi all.  I haven't got around to reading the draft (but will soon).  
> Prior to that, a few notes:
> 
> 1. I'm pretty sure that we need something better than what we have in 
> the area of JSON schemas.  At least, I'm 100% sure that my job at Amazon 
> Web Services would be easier, and our customer experiences would be more 
> pleasant, if we had something.
> 
> 2. One thing schemas are useful for is to syntax-check JSON texts that 
> claim to conform to some language specification or another. Obviously no 
> schema can ever completely satisfy this requirement - there are always 
> things in specifications which are semantic and not addressable by 
> schemas - but they can still be super useful.
> 
> 3. Another thing they are useful for is for providing help to developers 
> working in strongly typed programming languages. With a well-built 
> schema it is reasonably straightforward to auto-generate nice idiomatic 
> class declarations in modern programming languages, and also to build 
> serializers/deserializers that will move data back and forth between 
> JSON blobs and programming-language constructs, or fail in a clean 
> deterministic way if the JSON fails to match the schema.

For me:

4. Person-to-person communication is an important use-case for schemas 
as a way of describing valid formats, either in design documents or 
during brainstorming sessions on whiteboards or personal notes on the 
back of envelopes.

When you do that you want to be discussing JSON rather than also working 
out a convention for defining JSON. Hence the need for something already 
defined that is readily and widely understood.

The human need puts me off a JSON format for this.  It is too long 
winded and, like W3C XML Schema, unnecessarily difficult for humans to 
use. It's why XML Relax NG Compact Syntax was developed.  And why I 
prefer JSON Content Rules JSON-like (but not JSON) syntax.

You can get an idea of a comparison of the two types of specification at:

 
http://json-content-rules.org/drafts/draft-newton-json-content-rules-10-pjc.html#rfc.section.2.3

I my mind, JCR is a clear winner in this situation.

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------