Re: [Json] Allow any JSON value at the top level

Jacob Davies <jacob@well.com> Mon, 10 June 2013 21:36 UTC

Return-Path: <cromis@gmail.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 3097321F99B8 for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 14:36:50 -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=[AWL=-0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5kzGYG3Wyfwc for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 14:36:45 -0700 (PDT)
Received: from mail-qe0-f53.google.com (mail-qe0-f53.google.com [209.85.128.53]) by ietfa.amsl.com (Postfix) with ESMTP id 077E521F9A63 for <json@ietf.org>; Mon, 10 Jun 2013 14:36:44 -0700 (PDT)
Received: by mail-qe0-f53.google.com with SMTP id 1so4331770qee.26 for <json@ietf.org>; Mon, 10 Jun 2013 14:36:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=4bwobnnubrprP5r5v0v/u6Kop12PTS52J/ekBwCyZbk=; b=KAcYWePbXnQbUrlrVBtP/FdXFjpDbwGOskuvr0LzGFkJh9PU2T1afLJlSvPAP68Mlx zgr53XsYT7mh+I9JpNhFlKb9RGL0t4uEnPBXo2kQ0MWsbjNkuju2v7uOM0RAY4gIkc6X EGvGWptlKQ1k8qOdfj0Gy8nXZUHng+MELzu7odrk2fgxw1wH7u6LVE5Vjl+TrWJSphZQ 4GSRWMrKrD1R+F4D3VgLpGiPXtWgTW2qKoBl9phRHi799UETBi/dSXlrG/ldFq67PYhW 83NOl5eKvWv9y/0L7LWPf9LRWdTsCpxacSiIFmlV+LBeuex+QQvcIXUsc7bkSTKCP9mD F8rQ==
X-Received: by 10.224.11.199 with SMTP id u7mr15509749qau.76.1370900204465; Mon, 10 Jun 2013 14:36:44 -0700 (PDT)
MIME-Version: 1.0
Sender: cromis@gmail.com
Received: by 10.49.106.228 with HTTP; Mon, 10 Jun 2013 14:36:24 -0700 (PDT)
In-Reply-To: <20130610201746.GC1057@mercury.ccil.org>
References: <A723FC6ECC552A4D8C8249D9E07425A70FC33B5B@xmb-rcd-x10.cisco.com> <51b23e6d.6196420a.0b15.4245SMTPIN_ADDED_BROKEN@mx.google.com> <CAChr6SwrveU=fesF8VidDYWzeYMu2c1+=38+__BqHArxTiW5mg@mail.gmail.com> <51b4dbbe.64da440a.1fc2.6dd2SMTPIN_ADDED_BROKEN@mx.google.com> <CAChr6Sx_obmG+=sY100ySBLmevN0VJ_0Z9TjYGxcXKOx+UtnJA@mail.gmail.com> <51b4ec44.ea05420a.7c73.ffffa487SMTPIN_ADDED_BROKEN@mx.google.com> <CAChr6SxiZ2Yz6SiozQZpuYoGKSzWnUux6PukyWDkcvKsVyyRbQ@mail.gmail.com> <51b507b1.c686e00a.3a7e.ffffa0adSMTPIN_ADDED_BROKEN@mx.google.com> <CAO1wJ5R2H27qh-DWG5B8CzutkTFWxn-h+Qi1jiet23axxmvLyA@mail.gmail.com> <20130610201746.GC1057@mercury.ccil.org>
From: Jacob Davies <jacob@well.com>
Date: Mon, 10 Jun 2013 14:36:24 -0700
X-Google-Sender-Auth: orKWWHLCjJCk21HPaH0vfZ_W6Aw
Message-ID: <CAO1wJ5Q9mhspheU3h4NRx9x5LOz9yOgJBXhwPWBOVw-w71ncTQ@mail.gmail.com>
To: John Cowan <cowan@mercury.ccil.org>
Content-Type: text/plain; charset="ISO-8859-1"
Cc: Markus Lanthaler <markus.lanthaler@gmx.net>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Allow any JSON value at the top level
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <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: Mon, 10 Jun 2013 21:36:50 -0000

On Mon, Jun 10, 2013 at 1:17 PM, John Cowan <cowan@mercury.ccil.org> wrote:
> Jacob Davies scripsit:
>> The original specification has an asymmetry in what values may be sent
>> at the top level motivated by an encoding-detection scheme that is now
>> obsolete.
>
> How do we know what the motivation is?  I think the self-delimiting nature
> is more important.

The encoding-detection is the only motivation mentioned in the RFC,
and then only implicitly: "Since the first two characters of a JSON
text will always be ASCII characters [RFC0020], it is possible to
determine whether an octet stream is UTF-8, UTF-16 (BE or LE), or UTF
-32 (BE or LE) by looking at the pattern of nulls in the first four
octets."

Of course there can be other notable benefits or drawbacks regardless
of the stated motivation. Self-delimiting is a benefit, it appears.
The fact that a sub-part of a valid JSON text is not also a valid JSON
text is a drawback in an otherwise symmetric data model.

> In any case, even if numbers, strings, booleans, and null were allowed at
> the top level, all application/json entity bodies would still begin with
> a non-null ASCII character, which is sufficient for encoding detection.

Good to know.