Re: [Json] Counterproposal #2 on work items

Tim Bray <tbray@textuality.com> Wed, 20 February 2013 20:14 UTC

Return-Path: <tbray@textuality.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0C52E21F88CC for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 12:14:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.51
X-Spam-Level:
X-Spam-Status: No, score=-3.51 tagged_above=-999 required=5 tests=[AWL=-0.534, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, 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 nBvShvw1F3jI for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 12:14:38 -0800 (PST)
Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by ietfa.amsl.com (Postfix) with ESMTP id 4267D21F88C7 for <json@ietf.org>; Wed, 20 Feb 2013 12:14:38 -0800 (PST)
Received: by mail-pa0-f41.google.com with SMTP id fb11so4289097pad.28 for <json@ietf.org>; Wed, 20 Feb 2013 12:14:38 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=PUasyfjWy27eQDM3Mei9MgILKQZ7T/fq8fhReB0Z7/M=; b=mEt2BFJoVIU0arWflcPYYvLkU63QDP4MUwOnWTVufJyZ7/D0VTFJTJxOpBZ0gcnrsB lufXtlIqzGEk+PUYHh0/K+UwFphBNBmJmUW+/VAsuzQdtoJbiscNpQHvAE4Lm2wIuDL4 SwNzQI5/ybSm7YUFpOX8aB/ExTVFAfmeBrerw75UieeJCOtZnh3ozX2YS3SgtaMCRDak Cb2mN7IdT+Zmxz/tnTqRcjPs3eYlzbW1ovUY/srjp1TV9ChZJZqcT8gXBQ7Hov2Vme0s 5EkRy0TR00KI199CE9tpYBM2W1eyYtsnCHQofwphgiA5kUsINEL5q2DZCC//pY3slooY b0rw==
MIME-Version: 1.0
X-Received: by 10.66.4.193 with SMTP id m1mr4264222pam.214.1361391278031; Wed, 20 Feb 2013 12:14:38 -0800 (PST)
Received: by 10.66.249.129 with HTTP; Wed, 20 Feb 2013 12:14:37 -0800 (PST)
X-Originating-IP: [96.49.81.176]
In-Reply-To: <CALcybBCCtzxzZ2KLN83JnhJBkWe_WTMmKpo6ZcudcEgmL7XHdQ@mail.gmail.com>
References: <CAHBU6isrzwVwYcvucFrQjO=wSbp3S9f=CLXyU_8BznTpGZGSTQ@mail.gmail.com> <CALcybBCCtzxzZ2KLN83JnhJBkWe_WTMmKpo6ZcudcEgmL7XHdQ@mail.gmail.com>
Date: Wed, 20 Feb 2013 12:14:37 -0800
Message-ID: <CAHBU6isQRpaU2R2bBLjLhHs0Br_zE0XjvRpdNEC9nPGU7yKW0A@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: Francis Galiegue <fgaliegue@gmail.com>
Content-Type: multipart/alternative; boundary=bcaec520e7df87060a04d62d9b50
X-Gm-Message-State: ALoCoQnGv1SeyvQEpQ8UU/wH2QB2/9WgnZ+xWep665tNQ9pFU+iJsW/DJj8zwXUQe56DXW3AOn6h
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Counterproposal #2 on work items
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Discussion related to JavaScript Object Notation \(JSON\)." <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Feb 2013 20:14:39 -0000

I’m actually pretty sure about that one, for use in protocols.  If in some
protocol I'm going to send you 3 data items called “size”, “date”, and
“uid”, if I put them in a hash, then when for a later version we need to
add “ttl”, assuming a MUST-IGNORE policy, you can just do it.  If you’ve
put them in a tuple or some such, you have much less flexibility.  -T


On Wed, Feb 20, 2013 at 11:41 AM, Francis Galiegue <fgaliegue@gmail.com>wrote;wrote:

> On Wed, Feb 20, 2013 at 7:01 PM, Tim Bray <tbray@textuality.com> wrote:
> [...]
> > - always make the top-level construct an object
>
> Why?
>
> I have the totally opposite view -- right now only arrays and objects
> are dubbed as legal JSON texts. And I have never seen a parser raise
> an error if it were fed with anything else -- nor fail to produce
> anything else, for that matter.
>
> Restricting the top level construct to objects and arrays is "bad"
> enough, but restricting it even more? I think the _opposite_ should be
> done. JSON is flexible, restricting its flexibility would be a mistake
> imho.
>
> --
> Francis Galiegue, fgaliegue@gmail.com
> Try out your JSON Schemas: http://json-schema-validator.herokuapp.com
>