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

Nico Williams <nico@cryptonector.com> Thu, 22 May 2014 17:23 UTC

Return-Path: <nico@cryptonector.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 70BDE1A0226 for <json@ietfa.amsl.com>; Thu, 22 May 2014 10:23:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.044
X-Spam-Level:
X-Spam-Status: No, score=-1.044 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] 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 cEYdGzuAYE3U for <json@ietfa.amsl.com>; Thu, 22 May 2014 10:23:01 -0700 (PDT)
Received: from homiemail-a64.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id 240901A0236 for <json@ietf.org>; Thu, 22 May 2014 10:23:01 -0700 (PDT)
Received: from homiemail-a64.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a64.g.dreamhost.com (Postfix) with ESMTP id CFD1D438080 for <json@ietf.org>; Thu, 22 May 2014 10:22:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=YTkuSTGBj3rtZFDeBenk +Ukp/Q0=; b=HqIutqroAwSlvmmwXdH0Q4ZvhmkET18CT18myja4Z/8WnH+SAJY6 wQJCQeCRSZB+TX/dcBHAdpQL5ttv3+w4ZlHLN7PFhtvLXLkX5Fv8S1/leqMUrD1S DolXAXomcBEZ9JPEm2KU5e7pdbtfpanONynj93S4018Xzu+wETbW+b8=
Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a64.g.dreamhost.com (Postfix) with ESMTPSA id 6FE3C43807F for <json@ietf.org>; Thu, 22 May 2014 10:22:59 -0700 (PDT)
Received: by mail-we0-f179.google.com with SMTP id q59so3805360wes.10 for <json@ietf.org>; Thu, 22 May 2014 10:22:57 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.180.186.8 with SMTP id fg8mr17581356wic.39.1400779377936; Thu, 22 May 2014 10:22:57 -0700 (PDT)
Received: by 10.216.29.200 with HTTP; Thu, 22 May 2014 10:22:57 -0700 (PDT)
In-Reply-To: <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> <255B9BB34FB7D647A506DC292726F6E1154629EDF8@WSMSG3153V.srv.dir.telstra.com>
Date: Thu, 22 May 2014 12:22:57 -0500
Message-ID: <CAK3OfOgnWNOt++TfNLVwZD-enDWG2Y3GteRZqByE-pwGHb4N9w@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>
Content-Type: text/plain; charset=UTF-8
Archived-At: http://mailarchive.ietf.org/arch/msg/json/h3hnhf8VUWsVIUhykDvNsV9XFD0
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, 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 17:23:02 -0000

On Thu, May 22, 2014 at 12:21 AM, Manger, James
<James.H.Manger@team.telstra.com> wrote:
>>  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.

Good catch.

>>  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).

Ah, yes, because begin-* and end-* have ws.  Oh well, then I give up
on the greedy matching issue.

> 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

I'll take the second.  Thanks!

Nico
--