Re: [apps-discuss] JSON Schema considered harmful

"Tschofenig, Hannes (NSN - FI/Espoo)" <hannes.tschofenig@nsn.com> Thu, 20 September 2012 06:27 UTC

Return-Path: <hannes.tschofenig@nsn.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B3AC721F868A for <apps-discuss@ietfa.amsl.com>; Wed, 19 Sep 2012 23:27:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.35
X-Spam-Level:
X-Spam-Status: No, score=-106.35 tagged_above=-999 required=5 tests=[AWL=0.248, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OGIEoOlpdqxr for <apps-discuss@ietfa.amsl.com>; Wed, 19 Sep 2012 23:27:04 -0700 (PDT)
Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by ietfa.amsl.com (Postfix) with ESMTP id 915CA21F8686 for <apps-discuss@ietf.org>; Wed, 19 Sep 2012 23:27:03 -0700 (PDT)
Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd001.nsn-inter.net (8.12.11.20060308/8.12.11) with ESMTP id q8K6QxaI018645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Sep 2012 08:26:59 +0200
Received: from DEMUEXC047.nsn-intra.net ([10.159.32.93]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id q8K6Qvj7015034; Thu, 20 Sep 2012 08:26:59 +0200
Received: from FIESEXC035.nsn-intra.net ([10.159.0.25]) by DEMUEXC047.nsn-intra.net with Microsoft SMTPSVC(6.0.3790.4675); Thu, 20 Sep 2012 08:26:58 +0200
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CD96F8.EFDF6D7A"
Date: Thu, 20 Sep 2012 09:26:57 +0300
Message-ID: <999913AB42CC9341B05A99BBF358718D01DF0684@FIESEXC035.nsn-intra.net>
In-Reply-To: <CAMm+LwjYj0gd3Cxjj8WFcLy-zgBwfVDCPaRGcNSgOHD9m_07yw@mail.gmail.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: [apps-discuss] JSON Schema considered harmful
Thread-Index: Ac2WjIUxJJ87pqrCRxO8aqscjj5ybgAaNeiw
References: <CAMm+LwjYj0gd3Cxjj8WFcLy-zgBwfVDCPaRGcNSgOHD9m_07yw@mail.gmail.com>
From: "Tschofenig, Hannes (NSN - FI/Espoo)" <hannes.tschofenig@nsn.com>
To: ext Phillip Hallam-Baker <hallam@gmail.com>, Francis Galiegue <fgaliegue@gmail.com>
X-OriginalArrivalTime: 20 Sep 2012 06:26:58.0232 (UTC) FILETIME=[EFC4CB80:01CD96F8]
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: clean
X-purgate: This mail is considered clean (visit http://www.eleven.de for further information)
X-purgate-size: 10646
X-purgate-ID: 151667::1348122420-00006F5F-EB97186D/0-0/0-0
Cc: apps-discuss@ietf.org
Subject: Re: [apps-discuss] JSON Schema considered harmful
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 20 Sep 2012 06:27:05 -0000

My 5 cents to this topic. 

 

Even though many folks, including Tim Bray, educated the community that
it is not necessary to produce XML schemas when writing specifications
that use XML, everyone did. They felt that the specification was not
complete without the schema.

 

The consequence was that 

*        The XML replaced text in specifications leaving important
semantic unspecified. Look at many of the OASIS document, for example
CAP, and you know what I am talking about. The authors somehow thought
that the schema is a replacement for a description of what the protocol
actually does. Wrong! Interoperability problems are the consequence.

*        Sometimes the XML schema was provided in addition to a textual
description. Nice idea but then they often get out of sync. 

*        Extensibility thoughts were left behind. XML by itself meant
extensible, at least that's what many thought, and hence there was no
story about how the protocol would get extended in a smooth way and what
the policies are for extensions.

 

The worst thing was, however, that the entire protocol development was
guided by the (lack of) understanding of the XML schema language rather
than the requirements for the actual protocol. 

 

Funny enough the schema did not really help anyone: it did not help a
person reading the specification (who does not want to implement it)
since they typically care about an entire level of detail nor the guy
who wants to implements it. Just using the schema for an implementation
was never enough because you had to consider all the other special case
as well (which can typically only be found elsewhere in the
specification). If you managed to encode all the special cases into the
schema then it became unreadable. The instance validation against
concept was also useless once you included the proper extension points. 

 

In a nutshell, I think that XML (& Relax NG) schemas are harmful.
Unfortunately, it is already too late for fixing that in the IETF. I
believe we should not introduce schemas into JSON in the IETF.
Everything will be fine without using it. 

 

Ciao

Hannes