[Python-ideas] Adding jsonschema to the standard library

Stephen J. Turnbull stephen at xemacs.org
Thu May 21 09:39:56 CEST 2015


Demian Brecht writes:

 > RFC draft: https://tools.ietf.org/html/draft-zyp-json-schema-04

I note that this draft, apparently written in Nov. 2011, expired
almost two years ago with no update.  OTOH, 4 other RFCs related to
JSON (6901, 6902, 7386, 7396) have been published recently.  (This
kind of thing is common with RFCs; people get fed up with the process
and just go off and do something that's "good enough" for them.  But
it does show they've given up on the process of getting a global
standard at least for now.)  Then in Oct 2012, Andy Newton wrote[1]:

    Schemas. There is no one standardized schema language for JSON,
    although several are presently in the works (including one by this
    author). The need for a JSON schema language is controversial—JSON
    is regarded by most as simple enough on its own. Indeed, there is
    no shortage of JSON-based interchange specification making due
    without schema formalism.

and his independent proposal[2] (confusingly called "content rules")
is current, expiring on June 5.  (Note that there is no proposal
currently being discussed by the IETF APPSAWG.  Newton's proposal is
independent, pending formation of a new charter for a JSON schema WG.)

 > My question is: Is there any reason up front anyone can see that
 > this addition wouldn’t fly?

I would say that the evident controversy over which schema language
will be standardized is a barrier, unless you can say that Newton's
proposals have no support from the community or something like that.
It's not a terribly high barrier in one sense (Python doesn't demand
that modules be perfect in all ways), but you do have to address the
perception of controversy, I think (at least to deny there really is
any).

A more substantive issue is that Appendix A of Newton's I-D certainly
makes json-schema look "over the top" in verbosity of notation -- XML
would be proud.<wink />  If that assessment is correct, the module
could be considered un-Pythonic (see Zen #4, and although JSON content
rules are not themselves JSON while JSON schema is valid JSON, see Zen
#9).

N.B. I'm not against this proposal, just answering your question.

I did see that somebody named James Newton-King (aka newtonsoft.com)
has an implementation of json-schema for .NET, and json-schema.org
seems to be in active development, which are arguments in favor of
your proposal.

Footnotes: 
[1]  http://www.internetsociety.org/articles/using-json-ietf-protocols

[2]  https://tools.ietf.org/html/draft-newton-json-content-rules-04




More information about the Python-ideas mailing list