Re: [apps-discuss] Reviving JSON Schema

Phillip Hallam-Baker <hallam@gmail.com> Wed, 05 September 2012 23:33 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 7329F21F86E8 for <apps-discuss@ietfa.amsl.com>; Wed, 5 Sep 2012 16:33:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.499
X-Spam-Level:
X-Spam-Status: No, score=-3.499 tagged_above=-999 required=5 tests=[AWL=0.100, 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 EqWgZqrCGt5Z for <apps-discuss@ietfa.amsl.com>; Wed, 5 Sep 2012 16:33:47 -0700 (PDT)
Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by ietfa.amsl.com (Postfix) with ESMTP id B0DDC21F84E1 for <discuss@apps.ietf.org>; Wed, 5 Sep 2012 16:33:47 -0700 (PDT)
Received: by obbta17 with SMTP id ta17so1541576obb.22 for <discuss@apps.ietf.org>; Wed, 05 Sep 2012 16:33:47 -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=ral6hi0RVKG4FQzQyuol9CF/tD7eC2CxNSb1N9LxsBM=; b=Jxq3NUGOi2aMSf8BQRQNokzjiYV6EXEFPeHrRnALgBxWM7bkj61rcfKqg8yHriQ+aH V/C2+I+uG9dekKYjcxGJcR7Ch7QA9oTy6ZiYmWgJ3oJ66pR6ldGYtB4X3K1aCnuWwFZ2 LVHou43/SB5NwTv8uZJZMF1n0/VdKuGQbbLU5r15PlYbqdRQOdPOfoIwLgz7XZuY/G9H KbaoGq5n99WaKZWTQ4evA2hOoVKOBFmfEhnNYL4CdxjwxVLxtkFgJIVA/J9sis+HUzI7 p69wFBtDmn9xMDrzR86TbLxipReSJ2YnC2WL9i3Ml9Cz8TPIyQwkkCl6obs3ygrA1V+L eLdw==
MIME-Version: 1.0
Received: by 10.60.172.236 with SMTP id bf12mr177549oec.23.1346888027328; Wed, 05 Sep 2012 16:33:47 -0700 (PDT)
Received: by 10.76.80.10 with HTTP; Wed, 5 Sep 2012 16:33:47 -0700 (PDT)
In-Reply-To: <CAHBU6isRDKuFNu-ZKqNL-=8FSgWmDPo1fUoEkHXdQFYiSYKbGA@mail.gmail.com>
References: <CALcybBByASu5FT7FA8gkR++4QQHOjd+1QAmVYL3VLj53wRK6KA@mail.gmail.com> <m2y5kozjc3.fsf@ladislav.lhotka.nb1.wifi0.office.nic.cz> <CAMm+Lwg=5U9iq9WE05FEQs0r-D_EBXDu2jDiyVO52ZgqLZvG9g@mail.gmail.com> <CAHBU6it7=eeh1GQiec_B4=+S3NPPWHZpfAB5PWFuQvppeFKQVA@mail.gmail.com> <CALcybBAfCj57mfLNb08hP0uGNEhqpZuNokaG-MVhxQRHMOx41g@mail.gmail.com> <CAHBU6isRDKuFNu-ZKqNL-=8FSgWmDPo1fUoEkHXdQFYiSYKbGA@mail.gmail.com>
Date: Wed, 05 Sep 2012 19:33:47 -0400
Message-ID: <CAMm+LwhF1kGavRPRxN+YxoewYdpdYc7Thb1_q6XpNFM++83Ptw@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: Tim Bray <tbray@textuality.com>
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Cc: discuss@apps.ietf.org
Subject: Re: [apps-discuss] Reviving JSON Schema
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, 05 Sep 2012 23:33:48 -0000

On Wed, Sep 5, 2012 at 7:18 PM, Tim Bray <tbray@textuality.com> wrote:
> On Wed, Sep 5, 2012 at 4:11 PM, Francis Galiegue <fgaliegue@gmail.com> wrote:
>>> And then Java-like languages, there’s just really no good way to model
>>> the following, which might be a reasonable protocol element
>>>
>>> [  { "foo": 1, "bar" : false },   23,  "humpty-dumpty" ]
>>>
>>> at any level richer than List<Object>; so why bother?
>> Err...
>>
>> http://fasterxml.github.com/jackson-databind/javadoc/2.0.5/com/fasterxml/jackson/databind/JsonNode.html
>
> Sure, but I think Phillip was looking for a mapping into native data
> structures, not JSON objects. My argument is that this is trivial in
> Ruby/Python/Javascript, but impractical in Java & friends. -T

I have a generator for exactly that mapping, albeit for C# rather than Java.

Creating that mapping is precisely the reason I need a schema. That
and being able to document the protocol:

http://www.ietf.org/id/draft-hallambaker-omnibroker-02.txt

The code examples and the text are both generated from the schema.
That generator is set up to produce C# but C is only a little bit
harder.


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