Re: [Json] section 1 paragraph 2 on what JSON can represent

"Manger, James H" <James.H.Manger@team.telstra.com> Thu, 03 October 2013 01:57 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 6607321F9C38 for <json@ietfa.amsl.com>; Wed, 2 Oct 2013 18:57:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.901
X-Spam-Level:
X-Spam-Status: No, score=-0.901 tagged_above=-999 required=5 tests=[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 8mHQ1wNGCNf9 for <json@ietfa.amsl.com>; Wed, 2 Oct 2013 18:57:11 -0700 (PDT)
Received: from ipxano.tcif.telstra.com.au (ipxano.tcif.telstra.com.au [203.35.82.200]) by ietfa.amsl.com (Postfix) with ESMTP id ED4C821F9EA8 for <json@ietf.org>; Wed, 2 Oct 2013 18:55:11 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.90,1022,1371045600"; d="scan'208";a="161146860"
Received: from unknown (HELO ipcdni.tcif.telstra.com.au) ([10.97.216.212]) by ipoani.tcif.telstra.com.au with ESMTP; 03 Oct 2013 11:55:08 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7216"; a="123521849"
Received: from wsmsg3753.srv.dir.telstra.com ([172.49.40.174]) by ipcdni.tcif.telstra.com.au with ESMTP; 03 Oct 2013 11:55:08 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3753.srv.dir.telstra.com ([172.49.40.174]) with mapi; Thu, 3 Oct 2013 11:55:07 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Tony Hansen <tony@att.com>, JSON WG <json@ietf.org>
Date: Thu, 03 Oct 2013 11:55:06 +1000
Thread-Topic: [Json] section 1 paragraph 2 on what JSON can represent
Thread-Index: Ac6/qJz7wJ/XXJhgRzeBh/mEYOEmwgAKS11w
Message-ID: <255B9BB34FB7D647A506DC292726F6E115318CAD1F@WSMSG3153V.srv.dir.telstra.com>
References: <BF7E36B9C495A6468E8EC573603ED9411EF1BB0B@xmb-aln-x11.cisco.com> <CAChr6SyznBktmOLpT-EiZ5Nm_0jZ16M0tOo4aZ_jhSDb=HHDqg@mail.gmail.com> <23C96FBA-3419-4C97-A075-462F7443013A@vpnc.org> <CAHBU6is2WzCNCwa0PYMM1Hr3Lij0GxWkVtVUan9=JPbvv0YCZg@mail.gmail.com> <CAChr6Sw72kxm8qJiDu=XMnARCttQPc5GNRQaXz4Xw9y+6-3=Mg@mail.gmail.com> <421F79DF-0B88-4E24-8666-189228E6E189@vpnc.org> <524C73B7.1060104@att.com> <524C76B0.9040900@att.com>
In-Reply-To: <524C76B0.9040900@att.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: Re: [Json] section 1 paragraph 2 on what JSON can represent
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: Thu, 03 Oct 2013 01:57:29 -0000

> In 4627-JSON, Section 2 says that JSON-text is an object / array.
> In ECMA-JSON, Section 15.2 says that JSONtext is an object / array /
> string / number / boolean-literal / null-literal.
> ...
> Since we've as a WG rejected extending 4627-JSON to be compatible with
> ECMA-JSON,


Did we reject that? Lets un-reject it then.

There was a substantial discussion <http://www.ietf.org/mail-archive/web/json/current/msg00553.html>; half-a-dozen people strongly supported extending 4627-JSON to be compatible with ECMA-JSON; about 3 were strongly against; and a handful seemed to be in the middle.

There is clearly no major problem with allowing any JSON value at the top level as ECMAScript allows this and many implementations support it. It doesn't break backwards-compatibility as all existing texts are still valid. Objects and arrays are still self-delimiting if any systems rely on that implied property; and separating items with a space (or newline) trivially allows any JSON values to be self-delimiting. Auto-detecting charsets can still work. Detecting truncation (but not other varieties of modification) seems like a very marginal benefit, and would still apply to everything except numbers which are unlikely to be truncated as they are invariably short (eg 10s of bytes): noticing truncation of long items (objects, arrays, strings) is unchanged.

A note in 4627bis could still say you get more interoperability when sticking to objects and arrays at the top level.

A note in a subsequent JSON-best-practises doc could recommend using objects for messages in general, as they easily allows ignorable extensions via new elements.

--
James Manger