Re: [Json] Schemas & so on

"Joe Hildebrand (jhildebr)" <jhildebr@cisco.com> Mon, 02 May 2016 16:50 UTC

Return-Path: <jhildebr@cisco.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 74A3A12D15F for <json@ietfa.amsl.com>; Mon, 2 May 2016 09:50:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -15.517
X-Spam-Level:
X-Spam-Status: No, score=-15.517 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 nnFWlNhQu5NS for <json@ietfa.amsl.com>; Mon, 2 May 2016 09:50:29 -0700 (PDT)
Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 252DA12D596 for <json@ietf.org>; Mon, 2 May 2016 09:42:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1836; q=dns/txt; s=iport; t=1462207322; x=1463416922; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=qN8CmjEQj1lC0DpguR8aLehNPsrjy/73fVMpeS5aiQk=; b=Rpfoht7IouX+CRFPPw8dnZcUN/Lw1sniRPHtvvr2VyloR5RLJT8Z6Fl1 dGk/t0BKDaki9AFEu/sSJonhr8HlXZ+kVt3S0/MaEi54q6qdvFKYMLYRs TbpX7dbPcX3PWJy2b+Nhqe+ByhJC5KxpzjcXyTsbZxs4lEonY1iugekoS 4=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0BBBQA8gidX/49dJa1dgzhTfQa5foF2IoVuAhyBFToSAQEBAQEBAWUnhEIBAQQjEVUCAQgODAImAgICMBUQAgQBEogqDqoZkFsBAQEBAQEBAQEBAQEBAQEBAQEBAQERBHyFJYF2CIJOhD2DACuCKwWHc4VkgTKJCwGFe4gcjxGPMAEnCzCDa2yHSyUYfwEBAQ
X-IronPort-AV: E=Sophos;i="5.24,568,1454976000"; d="scan'208";a="268730221"
Received: from rcdn-core-7.cisco.com ([173.37.93.143]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2016 16:42:01 +0000
Received: from XCH-RTP-001.cisco.com (xch-rtp-001.cisco.com [64.101.220.141]) by rcdn-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id u42Gg1qL026546 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 2 May 2016 16:42:01 GMT
Received: from xch-rtp-001.cisco.com (64.101.220.141) by XCH-RTP-001.cisco.com (64.101.220.141) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Mon, 2 May 2016 12:42:00 -0400
Received: from xch-rtp-001.cisco.com ([64.101.220.141]) by XCH-RTP-001.cisco.com ([64.101.220.141]) with mapi id 15.00.1104.009; Mon, 2 May 2016 12:42:00 -0400
From: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
To: Tim Bray <tbray@textuality.com>, "json@ietf.org" <json@ietf.org>
Thread-Topic: [Json] Schemas & so on
Thread-Index: AQHRo/U855UvMn19j0KO3qh2throzZ+luaWA
Date: Mon, 02 May 2016 16:42:00 +0000
Message-ID: <219BB6FA-F597-4235-AE53-6FE861CA28A5@cisco.com>
References: <CAHBU6itCV9MXmALdKtE9-vjUPG6-6ZqdqzrmZkcEzSUysi3S-w@mail.gmail.com>
In-Reply-To: <CAHBU6itCV9MXmALdKtE9-vjUPG6-6ZqdqzrmZkcEzSUysi3S-w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.15.1.160411
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.19.203.19]
Content-Type: text/plain; charset="utf-8"
Content-ID: <0139D9708A6F914DA31711D661465457@emea.cisco.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/ufVBik6M3iTe5fbHevv9RT0cr_g>
Subject: Re: [Json] Schemas & so on
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
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: Mon, 02 May 2016 16:50:31 -0000

I've been using CDDL recently:

https://tools.ietf.org/html/draft-greevenbosch-appsawg-cbor-cddl-08


Even though it says "CBOR" in the name, it works *quite* nicely for JSON.  Install Ruby tooling with `gem install cddl`.  Perhaps Carsten can send us an updated pointer to the source for that tool.

Example CDDL:

person = {
  name: text,
  age: int
}


And a conforming person JSON would be: {"name": "Aardvark", "age": 1}

-- 
Joe Hildebrand




On 5/1/16, 2:55 PM, "json on behalf of Tim Bray" <json-bounces@ietf.org on behalf of tbray@textuality.com> wrote:

>
>
>I find myself tasked with specifying a JSON-based DSL and preparing it for public release, with a validator and so on.  
>
>
>I had never really concerned myself much with options for JSON language definition, but have discovered they’re not very good.  The JSON Schema project is not terribly appealing - opaque spec, poor documentation
> and tools - and smells of neglect (last I-D expired in 2013).  It's been suggested that a good approach would be just to write a jq program that emits true or false.
>
>
>Is there good conventional wisdom about formally specifying a JSON dialect?
>
>
>-- 
>- Tim Bray (If you’d like to send me a private message, see 
>https://keybase.io/timbray <https://keybase.io/timbray>)
>
>
>