Re: [apps-discuss] JSON Schema considered harmful

Phillip Hallam-Baker <hallam@gmail.com> Thu, 20 September 2012 17:53 UTC

Return-Path: <hallam@gmail.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 5922421F8757 for <apps-discuss@ietfa.amsl.com>; Thu, 20 Sep 2012 10:53:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.007
X-Spam-Level:
X-Spam-Status: No, score=-4.007 tagged_above=-999 required=5 tests=[AWL=-0.409, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
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 LjthXlRMySFl for <apps-discuss@ietfa.amsl.com>; Thu, 20 Sep 2012 10:53:40 -0700 (PDT)
Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) by ietfa.amsl.com (Postfix) with ESMTP id 390FE21F8752 for <apps-discuss@ietf.org>; Thu, 20 Sep 2012 10:53:40 -0700 (PDT)
Received: by oagn5 with SMTP id n5so2116615oag.31 for <apps-discuss@ietf.org>; Thu, 20 Sep 2012 10:53:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UXPBrPnCpXuhYURwnkx5/wqMtPQFiUJWz6ihRyHCR94=; b=pQ6IDJFtX1soZYlyRLlexK6MzIXxt0BNFmJwOqkl71pFXycvOvl3LokJQcOuSBWTio qgjVbxm44KQzCXFZn8UbZb1yxM47WNzVDoOWTO6ginRO3LAZjY1SAWKoFV3Hyly3hLQY WLv34tiiszDaUw70fDM8m6sE3Jg/xOGJQ8kSerLYQ2z/8uxUH5FKpsxwtsp54TBuKXcp 9b88CBUASvoBhdmklUVEmbwqQGXnjrPbHTDTVDdlRm2m/MEvIyZrUlIDhJNT4454WtMZ kyVk7oyaSq70DKdj5p5sBv76qR2TgUgY9MFtNNIJgAefp6aMVavqyrF8l1w70GuSQ5eY emHw==
MIME-Version: 1.0
Received: by 10.60.29.72 with SMTP id i8mr1901033oeh.26.1348163619788; Thu, 20 Sep 2012 10:53:39 -0700 (PDT)
Received: by 10.76.18.237 with HTTP; Thu, 20 Sep 2012 10:53:39 -0700 (PDT)
In-Reply-To: <ee5d315f-5e7a-4def-aa2c-781da88b75cd@email.android.com>
References: <CAMm+LwjYj0gd3Cxjj8WFcLy-zgBwfVDCPaRGcNSgOHD9m_07yw@mail.gmail.com> <999913AB42CC9341B05A99BBF358718D01DF0684@FIESEXC035.nsn-intra.net> <CAK3OfOgU-Kepre2Z2dg_S8DAVCU413SRvuWMvJcC3BmE0BjNbQ@mail.gmail.com> <505B43B3.7050503@berkeley.edu> <CAHBU6iupyZEhENRVYJ2sMNk79RSZbOVAawr6vP42uzNyO0z+Nw@mail.gmail.com> <ee5d315f-5e7a-4def-aa2c-781da88b75cd@email.android.com>
Date: Thu, 20 Sep 2012 13:53:39 -0400
Message-ID: <CAMm+Lwi1rT_h=v-5wB7JbFHREDAkDtmzF3Pm0at1khEXYEh7Og@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: "evan@status.net" <evan@status.net>
Content-Type: multipart/alternative; boundary="e89a8fb1f806a8162804ca25cd81"
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 17:53:42 -0000

I could try to upload my Goedel and ProtoGen toolset to Github.

this is the specification I am currently working on.

http://tools.ietf.org/html/draft-hallambaker-omnibroker-02

ProtoGen is a tool that is designed to help write specifications that also
emits code that may be used in either a validator or a test suite or
examples or production code.

You would want to use different back ends for each case though.


Now I did one thing which is a bit of a cheat and that is that I pushed the
integrity checking information into the HTTP wrapper rather than try to use
something like a JSON Signature approach. So that means that I do not have
to worry about how to define an integrity checking constraint at the
protocol level, I assume that to be done for me in the HTTP framing.

But looking how simple this approach turns out and how complex the
alternatives are, I think it is the right way forward.

On Thu, Sep 20, 2012 at 1:34 PM, evan@status.net <evan@status.net> wrote:

> Can we engrave these rules on a big rock somewhere?
>
>
> Tim Bray <tbray@textuality.com> wrote:
>>
>> On Thu, Sep 20, 2012 at 9:26 AM, Erik Wilde <dret@berkeley.edu> wrote:
>>
>> > i have to admit that i am really curious why the seasoned spec writers
>> that
>> > have voiced general concerns about the usefulness of schema languages
>> are
>> > feeling this way, but so far i have not really understood what they are
>> > saying. could somebody please try again, i'd really like to understand
>> why
>> > the general idea of describing protocol syntax in a semi-formal (as
>> opposed
>> > to non-formal) way is considered a bad idea.
>>
>> I gave a preso at IETF70 in Vancouver a few years ago which is advertised
>> as being XML-centric, but has (I think) useful things to say about
>> plain-text/binary/ASN.1/JSON/XML, and discusses about the proper place of
>> schemas: http://www.ietf.org/proceedings/70/slides/xmltut-0.pdf
>>
>> I believe:
>> - ASN.1 has been bypassed by history and has truly horrible tooling. Just
>> don’t go there.
>> - If you’re interchanging documents, use XML; if (much more common)
>> you’re interchanging data structures, use JSON.
>> - Do not use multiple syntaxes for the same protocol. Pick one of XML or
>> JSON and stick with it.
>> - The most important thing in defining a protocol is good clean
>> comprehensible human-readable prose.
>> - All the protocols I’ve ever seen have important constraints that can’t
>> be expressed usefully in declarative schema languages.
>> - Therefore, the next most important thing is an automated
>> validator/test-suite.
>> - A schema is a nice-to-have.
>> - If you’re in XML and want schema-ware, use RelaxNG. For an example, see
>> RFC4287.
>> - If your protocol is JSON, investment in a validator/test-suite has much
>> higher ROI than chasing schema unicorns.
>>
>>
>>
>> >
>> > thanks a lot and kind regards,
>> >
>> > dret.
>> >
>> > --
>> > erik wilde | mailto:dret@berkeley.edu  -  tel:+1-510-2061079 |
>> >            | UC Berkeley  -  School of Information (ISchool) |
>> >            | http://dret.net/netdret http://twitter.com/dret |
>> > _______________________________________________
>> > apps-discuss mailing list
>> > apps-discuss@ietf.org
>> > https://www.ietf.org/mailman/listinfo/apps-discuss
>>
>> ------------------------------
>>
>> apps-discuss mailing list
>> apps-discuss@ietf.org
>> https://www.ietf.org/mailman/listinfo/apps-discuss
>>
>>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss
>
>


-- 
Website: http://hallambaker.com/