[Json] Allow any JSON value at the top level

"Manger, James H" <James.H.Manger@team.telstra.com> Fri, 07 June 2013 03:51 UTC

Return-Path: <James.H.Manger@team.telstra.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 157AD21F9285 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 20:51:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.418
X-Spam-Level:
X-Spam-Status: No, score=-0.418 tagged_above=-999 required=5 tests=[AWL=0.483, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
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 zIG1Exnb11RV for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 20:51:17 -0700 (PDT)
Received: from ipxavo.tcif.telstra.com.au (ipxavo.tcif.telstra.com.au [203.35.135.200]) by ietfa.amsl.com (Postfix) with ESMTP id 0602321F848A for <json@ietf.org>; Thu, 6 Jun 2013 20:51:12 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.87,819,1363093200"; d="scan'208";a="139662322"
Received: from unknown (HELO ipccvi.tcif.telstra.com.au) ([10.97.217.208]) by ipoavi.tcif.telstra.com.au with ESMTP; 07 Jun 2013 13:51:12 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7098"; a="137000694"
Received: from wsmsg3753.srv.dir.telstra.com ([172.49.40.174]) by ipccvi.tcif.telstra.com.au with ESMTP; 07 Jun 2013 13:51:11 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3753.srv.dir.telstra.com ([172.49.40.174]) with mapi; Fri, 7 Jun 2013 13:51:11 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: "json@ietf.org" <json@ietf.org>
Date: Fri, 07 Jun 2013 13:51:09 +1000
Thread-Topic: Allow any JSON value at the top level
Thread-Index: Ac5jMj7wK5i9s5prS+2npykXIGILbg==
Message-ID: <255B9BB34FB7D647A506DC292726F6E1151B21F9A9@WSMSG3153V.srv.dir.telstra.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Subject: [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 03:51:26 -0000

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


ECMAScript already allows this. http://www.ecma-international.org/ecma-262/5.1/#sec-15.12

   * The top level JSONText production of the ECMAScript JSON grammar
     may consist of any JSONValue rather than being restricted to being
     a JSONObject or a JSONArray as specified by RFC 4627.

--
James Manger