Re: [Json] JSON Schema Language, Draft 01

Ulysse Carion <ulysse@segment.com> Sat, 29 June 2019 19:00 UTC

Return-Path: <ulysse@segment.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 8DFCA1201E6 for <json@ietfa.amsl.com>; Sat, 29 Jun 2019 12:00:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=segment.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 3TMv87wpdt9U for <json@ietfa.amsl.com>; Sat, 29 Jun 2019 12:00:27 -0700 (PDT)
Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 40790120232 for <json@ietf.org>; Sat, 29 Jun 2019 12:00:27 -0700 (PDT)
Received: by mail-io1-xd33.google.com with SMTP id m24so19733626ioo.2 for <json@ietf.org>; Sat, 29 Jun 2019 12:00:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=segment.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1eeIdj3FKKBNoBycW/ANFZAyKpznK7jOhAxBQByTHtY=; b=VKNLFwtgwQjD4f7kJTja/uhuHmHo0uS0HdQRQeu9hyNokLZCvtQn91pNBZIYHIKzh4 1X3MRR4bsppa+KxlBvOT81ovfnZJ/BaLokiHpAREOQrVsVLWrxu+UeWjRKzs/RN5o+nN dj9v2kIsCtqJ1NJvkdQARW87LcTu57zagzIXk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1eeIdj3FKKBNoBycW/ANFZAyKpznK7jOhAxBQByTHtY=; b=iKB2QVki8uRUCXVapT/zkRDgk1SM9z9B33fBqenA8/WiaHx6J+B69hS2x06vh0VmKU PtSrjtBKPXkVf2G5Z/ndQhA9IsahrGBQqdMvLfXyRU+wgWDVWPOWjVSP03dpeO8Hq/TG jwkkiDx3LA0x0/qnzI+gF/yAT2Q7EoUqYPzGXUeuzj4F16DVAEUuFII3k0FITxLGe43M Rj6bGMc2KVtebH0KP5GiYm1UMYuf4rG7W0H2lBTuzOl09xDUS6PgOz+cBsXLA4cPJswf kF1TUlfTrAZeZf3YDFKsJu98riou2QtJMbbrzDD367UnKoxFIMOKwiQSIYP3W+UDoSlx aX1w==
X-Gm-Message-State: APjAAAVanT/VCbYxK51V1E47PCYtB/VjmL0ZCN9eXBQgRrwl71mIA+Ic E94xtQC6znG+KSORyEaQQCd/l+z+xmxK96O1lTTS7KjFRUY=
X-Google-Smtp-Source: APXvYqx94GVdUDrTcKW2jV/708rmTlOCsgxjf8ZLpu3Do0Xa0wJj37iQiT/LLDSmGHasLZp6FMtIQSKbIIWp9Dd+Au8=
X-Received: by 2002:a02:ce37:: with SMTP id v23mr18488753jar.2.1561834826262; Sat, 29 Jun 2019 12:00:26 -0700 (PDT)
MIME-Version: 1.0
References: <CAJK=1Rh6gQE5-4aOu7ZM9Fc-q_hW79U_Q7wkmWwVRS0=GPAnxA@mail.gmail.com> <CAJK=1Ri=SeJFrkk7QeSmg2wQWqJF_5kbZ99CW6UVZHSZ7=bprQ@mail.gmail.com>
In-Reply-To: <CAJK=1Ri=SeJFrkk7QeSmg2wQWqJF_5kbZ99CW6UVZHSZ7=bprQ@mail.gmail.com>
From: Ulysse Carion <ulysse@segment.com>
Date: Sat, 29 Jun 2019 12:00:15 -0700
Message-ID: <CAJK=1RihXUfxw=waX82O87VHzEfFq+_XFEqjve0y+Bqu=rbGCQ@mail.gmail.com>
To: JSON WG <json@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000004b48d058c7b0294"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/_1QJe0mqZxECIyUzjOohewW8z4E>
Subject: Re: [Json] JSON Schema Language, Draft 01
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: Sat, 29 Jun 2019 19:00:44 -0000

Hi all,

I wanted to provide an update on working tooling I've built on top of the
latest draft of JSON Schema Language. I believe the ease with which such
tooling can be written can be seen as an important reason why a minimal
schema language for JSON is useful.

I've made a code generator (jsl-codegen), a schema inference tool
(jsl-infer), and a test data generator / fuzzer (jsl-fuzz). They're all
open-source and available here:

* https://github.com/json-schema-language/jsl-codegen
* https://github.com/json-schema-language/jsl-infer
* https://github.com/json-schema-language/jsl-fuzz

The jsl-codegen tool supports Java, Golang, and TypeScript. It's similar to
protoc in the gRPC world, or the OpenAPI code generator tools.

The final tool, jsl-fuzz, is similar to the "json-generate" feature in the
CDDL tool in:

https://www.rfc-editor.org/rfc/rfc8610.html#appendix-F

jsl-infer can be seen as the inverse of jsl-fuzz.

The small size of the JSL spec means that making tooling like this is
rather trivial. jsl-infer and jsl-fuzz are 350 and 150 LOC, respectively.

I'm curious if folks have thoughts / criticisms on this tooling?

Regards,
Ulysse

On Thu, Jun 6, 2019 at 8:04 PM Ulysse Carion <ulysse@segment.com> wrote:

> Oh wait, another big change -- I got rid of the URI-based reference stuff.
> Thanks to Tim Bray for pointing out it's kind of needlessly complex.
>
> On Thu, Jun 6, 2019 at 5:18 PM Ulysse Carion <ulysse@segment.com> wrote:
>
>> Hi folks,
>>
>> Working off discussion in this mailing list, I've published a draft -01
>> of JSON Schema Language:
>>
>> https://tools.ietf.org/html/draft-json-schema-language-01
>>
>> Notable changes are the addition of "timestamp" (RFC3339) as a type, as
>> well as the addition of enums. The syntax of JSL is now defined mostly
>> through CDDL, and an informative appendix maps some JSL schemas to CDDL
>> ones. The rest of the changes mostly serve to make the spec easier to read
>> and implement, nothing dramatic.
>>
>> Would love feedback! What more should be removed or added to move this
>> forward?
>>
>> Best,
>> Ulysse
>>
>