Re: [apps-discuss] JSON Schema considered harmful

Francis Galiegue <fgaliegue@gmail.com> Wed, 19 September 2012 21:49 UTC

Return-Path: <fgaliegue@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 179E721F845E for <apps-discuss@ietfa.amsl.com>; Wed, 19 Sep 2012 14:49:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.558
X-Spam-Level:
X-Spam-Status: No, score=-3.558 tagged_above=-999 required=5 tests=[AWL=0.041, BAYES_00=-2.599, 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 w2AMv0HPOfoh for <apps-discuss@ietfa.amsl.com>; Wed, 19 Sep 2012 14:49:34 -0700 (PDT)
Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by ietfa.amsl.com (Postfix) with ESMTP id 9B45521F8452 for <apps-discuss@ietf.org>; Wed, 19 Sep 2012 14:49:33 -0700 (PDT)
Received: by vcbfo14 with SMTP id fo14so1888824vcb.31 for <apps-discuss@ietf.org>; Wed, 19 Sep 2012 14:49:31 -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:content-transfer-encoding; bh=nAeGQB2zdJ+ijpDFdVy6X1mxlj5xp0V1ECMhr5y8fe4=; b=JWdPmsQyc9pGm2q+Vjlw47xv/k2LyALH/k6rwQIztHo+e+hkw9rkhoZsuPz2Tz2MUW g58tOXW0ec9jr5pRe9UbXAAP2EjLSzT4VJHzeuAZG9TVNv7f51EcFn+7vF5uA9KoyBYc v7gyZ0J+XBXqIZx3M6U7Uv1L+HSOViA0uGgoGU4UBqiq0Q9MJz1Heweem/ghzi0UrHtf zf2LdpKY0X0MUCW5MxpSPmVwlmGDW2bTjBaIvKrfbZmDkx1faogvp/naSKSnUR9h8CnG Fyg3nqpfqNZWiZcZP1X20Ceur+axr/xH0oIHWLi3A7Eekp3zOPCBf7jdAfKOkOlf54hJ QHmQ==
MIME-Version: 1.0
Received: by 10.52.64.209 with SMTP id q17mr2232018vds.32.1348091371743; Wed, 19 Sep 2012 14:49:31 -0700 (PDT)
Received: by 10.52.23.103 with HTTP; Wed, 19 Sep 2012 14:49:31 -0700 (PDT)
In-Reply-To: <CALcybBAwYPGep4QMGK1Bx0SSmB=yTXRbjH9VGPZ0MKHcQzr_Mw@mail.gmail.com>
References: <CAMm+LwjYj0gd3Cxjj8WFcLy-zgBwfVDCPaRGcNSgOHD9m_07yw@mail.gmail.com> <CALcybBCqAMLi8v61u1+oPpHaMpHrK4ufUm6fUUyMb8XMmz8JSg@mail.gmail.com> <CAMm+LwiyohqhRA+m3M0ViSkt74q3yOfUkZj8b-upc4V_qUv22g@mail.gmail.com> <CALcybBCBScuO797yBmY3c_wRUa98=DYwN2rXXbq41pE2GHK4vw@mail.gmail.com> <CAMm+LwgQLc8v+V7JhEr4zEw37e0ovrUkFy0RZKOszg1FbkMjeA@mail.gmail.com> <CALcybBDkOOfWq-qzR-6mtU8TULcp4BfS0h=WRKJZDSh+G8M9zw@mail.gmail.com> <CAMm+LwgNZuLYvyhayA2JQtH36e05HJWbdkKUt6yei10p5p-XRA@mail.gmail.com> <CALcybBAwYPGep4QMGK1Bx0SSmB=yTXRbjH9VGPZ0MKHcQzr_Mw@mail.gmail.com>
Date: Wed, 19 Sep 2012 23:49:31 +0200
Message-ID: <CALcybBCRi_O8EZ-6QGNFMXi5QzPVFq3h5M-2ZeAO=nM88GS9nQ@mail.gmail.com>
From: Francis Galiegue <fgaliegue@gmail.com>
To: Phillip Hallam-Baker <hallam@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: "apps-discuss@ietf.org" <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: Wed, 19 Sep 2012 21:49:35 -0000

On Wed, Sep 19, 2012 at 11:36 PM, Francis Galiegue <fgaliegue@gmail.com> wrote:
> On Wed, Sep 19, 2012 at 11:28 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
> [...]
>>>
>>> There is no maxOccurs, no minOccurs. Where on earth did you see that?
>>
>>
>> http://tools.ietf.org/html/draft-zyp-json-schema-03
>>
>>     5.13. minItems . . . . . . . . . . . . . . . . . . . . . . . . . 11
>>      5.14. maxItems . . . . . . . . . . . . . . . . . . . . . . . . . 11
>>
> [...]
>>
>> That would seem to be the same as the XML Schema constraints only someone
>> changed the name.
>>
>
> This is the old specification. It is being redone.
>
> And you don't understand JSON at all, do you? Can you tell a JSON
> array from a JSON object? From what I read: no...
>

Hint: this is a proposed text for the next version of the specification:

"JSON Schema does not mandate that an instance be of a particular
type: JSON Schema can process any JSON value, including null"

maxOccurs and minOccurs are _meaningless_ to JSON.

-- 
Francis Galiegue, fgaliegue@gmail.com
JSON Schema: https://github.com/json-schema
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)