[apps-discuss] Feedback on draft-zyp-json-schema-03

"Thomson, Martin" <Martin.Thomson@commscope.com> Thu, 28 July 2011 20:44 UTC

Return-Path: <Martin.Thomson@commscope.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 227AD5E800E for <apps-discuss@ietfa.amsl.com>; Thu, 28 Jul 2011 13:44:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.579
X-Spam-Level:
X-Spam-Status: No, score=-2.579 tagged_above=-999 required=5 tests=[AWL=0.020, BAYES_00=-2.599]
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 dCMCXrVyX86z for <apps-discuss@ietfa.amsl.com>; Thu, 28 Jul 2011 13:44:06 -0700 (PDT)
Received: from cdcsmgw01.commscope.com (fw.commscope.com [198.135.207.129]) by ietfa.amsl.com (Postfix) with ESMTP id 6548B5E8014 for <apps-discuss@ietf.org>; Thu, 28 Jul 2011 13:44:06 -0700 (PDT)
X-AuditID: 0a0404e8-b7c24ae000002adb-fe-4e31ca22c13f
Received: from ACDCE7HC1.commscope.com ( [10.86.20.102]) by cdcsmgw01.commscope.com (Symantec Brightmail Gateway) with SMTP id B3.04.10971.22AC13E4; Thu, 28 Jul 2011 15:44:18 -0500 (CDT)
Received: from SISPE7HC2.commscope.com (10.97.4.13) by ACDCE7HC1.commscope.com (10.86.20.102) with Microsoft SMTP Server (TLS) id 8.3.159.2; Thu, 28 Jul 2011 15:44:04 -0500
Received: from SISPE7MB1.commscope.com ([fe80::9d82:a492:85e3:a293]) by SISPE7HC2.commscope.com ([fe80::58c3:2447:f977:57c3%10]) with mapi; Fri, 29 Jul 2011 04:44:01 +0800
From: "Thomson, Martin" <Martin.Thomson@commscope.com>
To: "apps-discuss@ietf.org" <apps-discuss@ietf.org>, "draft-zyp-json-schema@tools.ietf.org" <draft-zyp-json-schema@tools.ietf.org>
Date: Fri, 29 Jul 2011 04:44:00 +0800
Thread-Topic: Feedback on draft-zyp-json-schema-03
Thread-Index: AcxNZbY9SgSmDFKXS1+wIODcDsUXTA==
Message-ID: <8B0A9FCBB9832F43971E38010638454F040D2C392C@SISPE7MB1.commscope.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Brightmail-Tracker: AAAAAA==
Subject: [apps-discuss] Feedback on draft-zyp-json-schema-03
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, 28 Jul 2011 20:44:07 -0000

Wow.

There is way too much stuff in this document.  It includes far more than I expected to find.  Some of that is pretty cool and I'd encourage you to find a way to submit a draft on each of:

 - the link relation type (this shouldn't just be constrained to JSON schemas)

 - the grammar for identifying parts of a JSON document

For that reason, I did not review Sections 4 and 6.

You'll notice that I don't have a lot of criticisms on the core schema stuff.  Despite these criticisms, the core of the specification is looking pretty strong.

Criticisms:

The simple type constraints (or facets) in XML schema are quite good, widely understood and fairly simple.  I'd encourage you to borrow these wholesale - semantics, names and all.

Complex types cannot be defined outside of the context where they are used.  For more complicated schema documents, the ability to define a set of properties, assign them an identity and include this set by reference would be a powerful tool.

The extension mechanism is a tough one to get right.  Such things are a royal pain in XML schemas and only marginally better in RelaxNG.  By addressing the above, this feature might not be necessary.

I really don't like the way that arrays can have different types at each position in the array.  I appreciate that JSON can do this, but there is no need to condone that sort of behaviour.

I really like the idea that the default mode is for objects to be extensible by default.  The idea that you might identify a specific schema (in additionalProperties/additionalItems) that is valid for extension, I like a whole lot less.  And why is it just one schema?  I don't see a strong case for this sort of feature.

I didn't get dependencies, but I didn't try that hard.  The description was confusing and it smells pretty bad.

Section 7 made little sense to me.

Questions:

Can default have an object value?  I assume yes.

Does the default have to be valid according to the grammar?

Why do $ref and $schema have the '$'?  Since you've no risk of collision, why not just drop it?

--Martin