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

Paul Hoffman <paul.hoffman@vpnc.org> Fri, 07 June 2013 15:40 UTC

Return-Path: <paul.hoffman@vpnc.org>
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 A5D8B21F9711 for <json@ietfa.amsl.com>; Fri, 7 Jun 2013 08:40:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.334
X-Spam-Level:
X-Spam-Status: No, score=-102.334 tagged_above=-999 required=5 tests=[AWL=0.265, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 ndtz11t+8zMZ for <json@ietfa.amsl.com>; Fri, 7 Jun 2013 08:40:15 -0700 (PDT)
Received: from hoffman.proper.com (IPv6.Hoffman.Proper.COM [IPv6:2605:8e00:100:41::81]) by ietfa.amsl.com (Postfix) with ESMTP id 231BF21F9704 for <json@ietf.org>; Fri, 7 Jun 2013 08:40:10 -0700 (PDT)
Received: from [10.20.30.90] (50-0-66-165.dsl.dynamic.sonic.net [50.0.66.165]) (authenticated bits=0) by hoffman.proper.com (8.14.5/8.14.5) with ESMTP id r57Fe9av081461 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for <json@ietf.org>; Fri, 7 Jun 2013 08:40:09 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
From: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E1151B21F9A9@WSMSG3153V.srv.dir.telstra.com>
Date: Fri, 07 Jun 2013 08:40:08 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <3B4E7F65-B9B9-4C95-B077-D178B8DD8216@vpnc.org>
References: <255B9BB34FB7D647A506DC292726F6E1151B21F9A9@WSMSG3153V.srv.dir.telstra.com>
To: "json@ietf.org" <json@ietf.org>
X-Mailer: Apple Mail (2.1508)
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: Fri, 07 Jun 2013 15:40:15 -0000

<no hat>

On Jun 6, 2013, at 8:51 PM, "Manger, James H" <james.h.manger@team.telstra.com> wrote:

> The current spec only allows a JSON text to be an object or array. Section 2. "JSON Grammar" says:
> 
>   A JSON text is a serialized object or array.
> 
>   JSON-text = object / array
> 
> 
> I propose allowing a JSON text to be any JSON value.
> 
>   A JSON text is a serialization of any JSON value.
> 
>   JSON-text = value
> 
>   value = false / null / true / object / array / number / string

+1 to this, and to removing the "how to tell if you are looking at a JSON text" from the parser section. That rule is fragile and not useful.

I am interested to hear examples of where this change would cause breakage, particularly given that ECMAScript already has this rule.

--Paul Hoffman