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

"Joe Hildebrand (jhildebr)" <jhildebr@cisco.com> Fri, 07 June 2013 16:43 UTC

Return-Path: <jhildebr@cisco.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 CB3F821F96F2 for <json@ietfa.amsl.com>; Fri, 7 Jun 2013 09:43:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
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 3zZlaWaw-Q3A for <json@ietfa.amsl.com>; Fri, 7 Jun 2013 09:43:43 -0700 (PDT)
Received: from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76]) by ietfa.amsl.com (Postfix) with ESMTP id 9F8BC21F95EF for <json@ietf.org>; Fri, 7 Jun 2013 09:43:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1473; q=dns/txt; s=iport; t=1370623423; x=1371833023; h=from:to:subject:date:message-id:in-reply-to:content-id: content-transfer-encoding:mime-version; bh=bouo8B2mdbE4Jp2vfy1zkLcSfLZTwG+IuapTv5o3cHo=; b=gqqpU6niZehEqAcYcGSqz1bYJQ76SiVRWYDA4F81/pnTupUSZ0+IxKim DUmGSVBmn2fuO4jB7dGk1kBOc8sLsQUUs18StQ7RHnZlWdJSJJxfZo7hL 8QWs+vWQtXpQnMpzqxW0sttM6AMNI5m3zSS+fQiGNOoLqeaBh6tEuU/uN E=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhIFALUMslGtJV2b/2dsb2JhbABZgwkwvm+BABZ0giUBBAEBAWsdAQgiSwslAQEEARIIh3MDDwy0HR2IQo8HOIJ7YQOpAoMPgic
X-IronPort-AV: E=Sophos;i="4.87,823,1363132800"; d="scan'208";a="220126064"
Received: from rcdn-core-4.cisco.com ([173.37.93.155]) by rcdn-iport-5.cisco.com with ESMTP; 07 Jun 2013 16:43:43 +0000
Received: from xhc-aln-x13.cisco.com (xhc-aln-x13.cisco.com [173.36.12.87]) by rcdn-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id r57Ghggc021773 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 7 Jun 2013 16:43:42 GMT
Received: from xmb-rcd-x10.cisco.com ([169.254.15.56]) by xhc-aln-x13.cisco.com ([173.36.12.87]) with mapi id 14.02.0318.004; Fri, 7 Jun 2013 11:43:42 -0500
From: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
To: "Manger, James H" <James.H.Manger@team.telstra.com>, "json@ietf.org" <json@ietf.org>
Thread-Topic: [Json] Allow any JSON value at the top level
Thread-Index: Ac5jMj7wK5i9s5prS+2npykXIGILbgAY4nWA
Date: Fri, 07 Jun 2013 16:43:42 +0000
Message-ID: <A723FC6ECC552A4D8C8249D9E07425A70FC3397C@xmb-rcd-x10.cisco.com>
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E1151B21F9A9@WSMSG3153V.srv.dir.telstra.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.3.4.130416
x-originating-ip: [64.101.72.72]
Content-Type: text/plain; charset="iso-8859-2"
Content-ID: <FC7F2E680FB60E479EC7C3ECC200E830@emea.cisco.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
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 16:43:51 -0000

I like this change, but it has impact on section three.  These JSON docs:

0
""
"?"

means that the table should probably look like:

   00 00 00 xx  UTF-32BE
   00 xx ?? xx  UTF-16BE
   xx 00 00 00  UTF-32LE
   xx 00 xx ?? UTF-16LE
   xx xx ?? ?? UTF-8

algorithmically:

if length<2
  return UTF-8
if buf[0]
  if buf[1]
    return UTF-8
  if length<4 or buf[2]
    return UTF-16LE
  return UTF-32LE
if buf[1]
  return UTF-16BE
return UTF-32BE



On 6/6/13 9: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
>
>
>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
>
>
>_______________________________________________
>json mailing list
>json@ietf.org
>https://www.ietf.org/mailman/listinfo/json
>


-- 
Joe Hildebrand