Re: [Json] Seeking more input on draft-ietf-json-text-sequence

"Manger, James" <James.H.Manger@team.telstra.com> Thu, 22 May 2014 05:21 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 (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B3CB41A00BE for <json@ietfa.amsl.com>; Wed, 21 May 2014 22:21:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.202
X-Spam-Level:
X-Spam-Status: No, score=-0.202 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RCVD_IN_DNSWL_NONE=-0.0001, RELAY_IS_203=0.994] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id siUCBN33FU6R for <json@ietfa.amsl.com>; Wed, 21 May 2014 22:21:43 -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 210631A004D for <json@ietf.org>; Wed, 21 May 2014 22:21:41 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.98,885,1392123600"; d="scan'208";a="204006444"
Received: from unknown (HELO ipccni.tcif.telstra.com.au) ([10.97.216.208]) by ipoani.tcif.telstra.com.au with ESMTP; 22 May 2014 15:21:38 +1000
X-IronPort-AV: E=McAfee;i="5600,1067,7445"; a="234228879"
Received: from wsmsg3704.srv.dir.telstra.com ([172.49.40.197]) by ipccni.tcif.telstra.com.au with ESMTP; 22 May 2014 15:21:39 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3704.srv.dir.telstra.com ([172.49.40.197]) with mapi; Thu, 22 May 2014 15:21:38 +1000
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Nico Williams <nico@cryptonector.com>, Paul Hoffman <paul.hoffman@vpnc.org>
Date: Thu, 22 May 2014 15:21:37 +1000
Thread-Topic: [Json] Seeking more input on draft-ietf-json-text-sequence
Thread-Index: Ac91KZILu29unWSlRzSbSyVhaahQOwAUJKSA
Message-ID: <255B9BB34FB7D647A506DC292726F6E1154629EDF8@WSMSG3153V.srv.dir.telstra.com>
References: <20140509173159.28855.94523.idtracker@ietfa.amsl.com> <A89181FF-2FAB-4C17-86AC-685D09AD0CA4@vpnc.org> <CAK3OfOi46pdC_oBOMHAo2o5Ld_UgaAm00o7D9a0HNubr=0vKBw@mail.gmail.com>
In-Reply-To: <CAK3OfOi46pdC_oBOMHAo2o5Ld_UgaAm00o7D9a0HNubr=0vKBw@mail.gmail.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
Archived-At: http://mailarchive.ietf.org/arch/msg/json/q9AQtjLkSchx4__2fo54zoXew0g
Cc: IETF JSON WG <json@ietf.org>
Subject: Re: [Json] Seeking more input on draft-ietf-json-text-sequence
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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, 22 May 2014 05:21:44 -0000

>  JSON-sequence = *(JSON-text LF)

No, because that means a payload of, say, 2 newlines is invalid. It should be a valid sequence of 0 JSON items. It is too easy to get stray newlines to reject them.

>  JSON-sequence = *ws *(value text-sep *ws)
>  text-sep = *(SP / HTAB / CR) LF ; these are from RFC5234
>  ws = <given by RFC7159>
>  value = <given by RFC7159>

This still does not deal with greedy parsers as <value> includes leading and trailing optional whitespace for objects and arrays (but not for primitives).

Acceptable versions:

  JSON-sequence = *(JSON-text LF) ws
or
  JSON-sequence = ws *(JSON-text ws LF ws)

with
  ws = <given by RFC7159> ; optional whitespace
  JSON-text = <given by RFC7159>
  LF = <given by RFC5234> ; linefeed %x0A

--
James Manger