[apps-discuss] JSON Content Rules and the need for schema languages for JSON

Andrew Newton <andy@hxr.us> Thu, 20 September 2012 18:58 UTC

Return-Path: <andy@hxr.us>
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 A134C21F870A for <apps-discuss@ietfa.amsl.com>; Thu, 20 Sep 2012 11:58:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.977
X-Spam-Level:
X-Spam-Status: No, score=-2.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, 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 1OIS2DFFj7f6 for <apps-discuss@ietfa.amsl.com>; Thu, 20 Sep 2012 11:58:39 -0700 (PDT)
Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by ietfa.amsl.com (Postfix) with ESMTP id 218F221F860B for <apps-discuss@ietf.org>; Thu, 20 Sep 2012 11:58:38 -0700 (PDT)
Received: by lboj14 with SMTP id j14so2580449lbo.31 for <apps-discuss@ietf.org>; Thu, 20 Sep 2012 11:58:38 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=NgED0iUU4l2vgFd5TEzjFQ6Q9QelpP4qcpl5fZR5pyI=; b=iTPg6fwyvr6+f3xvHQnLWGNV6xz0UBhSgVwZFfYgL3patHFbUFyQtzqWPqxhBi6qjH wX2pcYtX0eXEtidqNKOQZo6mEl46/MfFsp5cIMv5d3VCpWbfrz9SXjivinivAyOp6vlM j+mMTB5KAUTtYoauleBLuZDE4OKiYn/Shaz5WJUloE0JxwaK80cCYK3ClT/lBcb5pm1j Je0TzhQ0+p2Zil1FSS7kXnKYfqWU/SLHy+rYZ645O0PVKJTa1DWT+/38oj7fKs+/Fumq 4FkCdu1Mntq67y0oT8Z1AvtxVmOjF7hjD/EmZZbd7Xhcm1ABDfvGH8Kabmd14Gvc8y0P e9pw==
MIME-Version: 1.0
Received: by 10.112.102.68 with SMTP id fm4mr953758lbb.19.1348167518021; Thu, 20 Sep 2012 11:58:38 -0700 (PDT)
Received: by 10.112.7.67 with HTTP; Thu, 20 Sep 2012 11:58:38 -0700 (PDT)
X-Originating-IP: [2001:500:4:15:f53f:d67e:556a:1da5]
Date: Thu, 20 Sep 2012 14:58:38 -0400
Message-ID: <CAAQiQRfGuLHx2ZWUb9sMKUCXAN27aMq5QUr0=vmosexmmm1eAQ@mail.gmail.com>
From: Andrew Newton <andy@hxr.us>
To: apps-discuss@ietf.org
Content-Type: text/plain; charset="ISO-8859-1"
X-Gm-Message-State: ALoCoQm8g0Of1mUmZDu4y5vSXLNuH9Xwy8NxWuqiK6Gh37RmL75iyxgwnCVloDA3C2UmJ+PSiibJ
Subject: [apps-discuss] JSON Content Rules and the need for schema languages for JSON
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 18:58:40 -0000

All,

Since the topics of JSON Schema and schema languages in general are
being debated here, I thought I'd go ahead and publish a draft idea I
had for formalizing expected JSON structures. The draft is here:

http://www.ietf.org/id/draft-newton-json-content-rules-00.txt

While the notion that this is better (or worse) than JSON Schema is
subjective, I do think it turns out to be more concise.

Also, I think it worth mentioning what the ALTO working group has
done. They have a protocol to pass data in JSON, and to describe their
JSON structures they have repurposed C struct syntax to describe it.
You can find that draft here:

http://www.ietf.org/id/draft-ietf-alto-protocol-13.txt

While some see no value in schema languages for JSON (or schema
languages in general), there does appear to be an interest in methods
more formal than prose to describe expected content of JSON data. At
the very least, they can provide clarity for protocol specifications.
I'll note that while I was working up one of the examples for my
draft, I found an error in the prose of another JSON protocol on which
I had been working.

-andy