Re: JSON headers

On Fri, Jul 8, 2016 at 10:49 AM, Poul-Henning Kamp <>

> How do we specify this in RFCs
> ------------------------------
> This is the BIG one.
> Julians draft does not addrss this at all:  We need a "ABNF" for
> specifying the structured syntax of standard headers.
> Before we open the floodgates for JSON (or whatever) headers,
> we absolutely have to have found and nailed down how they will
> be documented/specified in RFCs.

​In my work at AWS I am in the middle of shipping a product with a JSON DSL
and writing a validator for the DSL.  The current repertoire of tools for
specifying and syntax-checking JSON declaratively is ​somewhere between
miserable and pathetic.  JSON Schema is better than nothing but the nature
of its construction makes it basically impossible to produce human-friendly
error messages.  CDDL and JSON Content Rules are interesting attempts but
still not remotely mature.

Also, I have found it more or less impossible to write MustIgnore rules
into JSON Schema saying like “If you spot a field you don't recognize,
that's OK, but if this field does occur it MUST meet these constraints”.
Which I think is important for network payloads.

At work, we actually used JSON Schema to help validate (better than
nothing), but with buckets of procedural code for this and that.  In the
actual specification we're going to publish, screw the schema stuff, it's
all IETF-style English prose: “The Foo object MUST contain a field named
Bar whose value MUST be an array all of whose members MUST be strings that
<description of required string syntax>”.

I’m actually not convinced that the lack of a good way to declaratively
specify a JSON DSL, for example for HTTP headers, is that big of a
problem.  Schemas are overrated.  Clear English prose is under-rated.

Received on Saturday, 9 July 2016 17:48:23 UTC