W3C home > Mailing lists > Public > public-wot-ig@w3.org > February 2017

JSON Schema verbosity

From: Henry Andrews <henry@cloudflare.com>
Date: Thu, 9 Feb 2017 15:30:53 -0800
Message-ID: <CANp5f1MNUhiLr4wf4SRgY-gz--XouuMS5_S-Pzh7yoR09gNngw@mail.gmail.com>
To: public-wot-ig@w3.org
Hi folks,
  It was wonderful to meet many of you at the F2F this week!  For those who
were not in attendance, I'm one of the authors of the forthcoming draft of
JSON Schema.

  I wanted to follow up on the concerns over JSON Schema's verbosity.  I
can think of a few ways in which it is verbose which call for various
different solutions.  I'm not sure which are of primary concern to the
group so here they are:

* JSON takes up too much space on the wire.

Encoding JSON Schemas as CBOR seems the ideal solution, and perhaps
registering a schema+cbor media type as well as schema+json.  See also
https://github.com/json-schema-org/json-schema-spec/issues/6 (although
there's a bit of a digression taking up a lot of space in the comments, I'm

* JSON itself is verbose and, as a human, reading large JSON documents is

I tend to write and review schemas in YAML and then convert them to JSON as
a build step of some sort.  YAML is close to JSON but significantly more
compact.  Also, it supports comments :-)

* JSON Schema has verbose keywords like "additionalProperties"

It seems like perhaps a terse version that would, for instance, use "ap" in
place of "additionalProperties" could help if this is a concern.  Although
if we establish JSON Schema validation as a vocabulary that JSON-LD can
pull in, JSON-LD can handle aliasing the terms to whatever makes sense for
that document's authors.

* Describing nested structures in JSON Schema takes up a lot of space.

There is a "deepProperties"/"deepRequired" proposal that would help with
this- I was initially not a fan of it but I'm warming to the idea.  Please
feel free to comment on it:

Did I miss anything?  Any thoughts on these possible solutions?




   *Henry Andrews*  |  Systems Engineer

   1 888 99 FLARE  |  www.cloudflare.com
Received on Sunday, 12 February 2017 15:18:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:27:10 UTC