Re: [Json] Accidental schema language

Ladislav Lhotka <lhotka@nic.cz> Fri, 02 December 2016 09:01 UTC

Return-Path: <lhotka@nic.cz>
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 371661293E3 for <json@ietfa.amsl.com>; Fri, 2 Dec 2016 01:01:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.896
X-Spam-Level:
X-Spam-Status: No, score=-9.896 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, RP_MATCHES_RCVD=-2.896] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 EaOaCldDiwHK for <json@ietfa.amsl.com>; Fri, 2 Dec 2016 01:01:18 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 78D1A1204D9 for <json@ietf.org>; Fri, 2 Dec 2016 01:01:18 -0800 (PST)
Received: from [IPv6:2001:718:1a02:1:8c0b:6279:7833:d775] (unknown [IPv6:2001:718:1a02:1:8c0b:6279:7833:d775]) by mail.nic.cz (Postfix) with ESMTPSA id 7A96E62522; Fri, 2 Dec 2016 10:01:15 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1480669275; bh=Yp6vCcc4QjAG7izcEEuIR32utXrMEbwk4IJM1IeRS9g=; h=From:Date:To; b=EA1FEVpx3rQu83cemOLeHsID+A5oKK/sjgs31COjqD0pOFaTEUwEsNRIwBdhs4DIh WUlay8GPa857j/uxVkhIHuTZARPp4u0nL3iFiMgaRdOuqO1S6sROfQDAqvZbx93iPx 4dLKPIoeDSnH9rhNqZNYHE08dJnHWixKxPozVT/Y=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <CAHBU6ivTaiHyBXBRBPjc3t=eM_zSd64mQ3h2f9o6WO4sMyXWsg@mail.gmail.com>
Date: Fri, 02 Dec 2016 10:01:18 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <B088A186-5FB9-4E9D-A37E-586EAF903E79@nic.cz>
References: <CAHBU6ivTaiHyBXBRBPjc3t=eM_zSd64mQ3h2f9o6WO4sMyXWsg@mail.gmail.com>
To: Tim Bray <tbray@textuality.com>
X-Mailer: Apple Mail (2.3251)
X-Virus-Scanned: clamav-milter 0.98.7 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/oJWLZJ1pd7olO1h0KYxySWGh1Zc>
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Accidental schema language
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: Fri, 02 Dec 2016 09:01:22 -0000

> On 2 Dec 2016, at 02:55, Tim Bray <tbray@textuality.com> wrote:
> 
> I had to write a validator for a JSON DSL in an AWS product, and I ended up sketching in a sort of one-off schema language for the purpose. Of the 27 people on earth who care about such things, a majority are probably on this mailing list: https://www.tbray.org/ongoing/When/201x/2016/12/01/J2119-Validator
> ​

FWIW, I wrote a validator for JSON that's based on James Clark's approach using derivatives of patterns. It is part of the Yangson library (Python 3):

https://github.com/CZ-NIC/yangson

The schema language in this case is YANG but it should be really easy to adapt it for DSL.

Lada

> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C