Re: [Json] Leading and trailing whitespace

"Jim Schaad" <ietf@augustcellars.com> Tue, 11 June 2013 03:02 UTC

Return-Path: <ietf@augustcellars.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 C457111E80D5 for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 20:02:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 qUP8Ws7Mqs23 for <json@ietfa.amsl.com>; Mon, 10 Jun 2013 20:02:26 -0700 (PDT)
Received: from smtp1.pacifier.net (smtp1.pacifier.net [64.255.237.171]) by ietfa.amsl.com (Postfix) with ESMTP id 4239E11E80CC for <json@ietf.org>; Mon, 10 Jun 2013 20:02:26 -0700 (PDT)
Received: from Philemon (mail.augustcellars.com [50.34.17.238]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jimsch@nwlink.com) by smtp1.pacifier.net (Postfix) with ESMTPSA id ADEA22C9F4; Mon, 10 Jun 2013 20:02:25 -0700 (PDT)
From: "Jim Schaad" <ietf@augustcellars.com>
To: "'Paul Hoffman'" <paul.hoffman@vpnc.org>
References: <06c101ce6625$0f891bf0$2e9b53d0$@augustcellars.com> <379266A1-82C1-4FF5-BD7C-EE657F1FD41F@vpnc.org> <06e901ce6638$e8f27a90$bad76fb0$@augustcellars.com> <51DE7E41-D682-4340-A234-7F7CFE513C10@vpnc.org> <070b01ce664b$e5e0ac10$b1a20430$@augustcellars.com> <6E03D281-D6BA-424D-A30A-3DA18E61A051@vpnc.org>
In-Reply-To: <6E03D281-D6BA-424D-A30A-3DA18E61A051@vpnc.org>
Date: Mon, 10 Jun 2013 20:01:33 -0700
Message-ID: <071201ce664f$fb885af0$f29910d0$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQIjA7ejHysocqIyb9p/XvW1gI4I3gIdfG2fAXcnW3oCcTmHLQEVs18kAL9FaTSYR8EgoA==
Content-Language: en-us
Cc: json@ietf.org
Subject: Re: [Json] Leading and trailing whitespace
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: Tue, 11 Jun 2013 03:02:36 -0000

> -----Original Message-----
> From: Paul Hoffman [mailto:paul.hoffman@vpnc.org]
> Sent: Monday, June 10, 2013 7:53 PM
> To: Jim Schaad
> Cc: json@ietf.org
> Subject: Re: [Json] Leading and trailing whitespace
> 
> On Jun 10, 2013, at 7:32 PM, "Jim Schaad" <ietf@augustcellars.com> wrote:
> 
> > Ok - I used the wrong term - I need to get them clearer, I still am
> > trying to learn - Please read JSON text for JSON text string.  I was
> > not using string as a value in this location.
> 
> You can't ask that question because the current doc only allows arrays and
> objects at the top level, and the starting character for each of those
allow for
> white space.
> 
> You might be asking "if we allow other JSON items at the top level, will
we
> also allow optional whitespace before and after". But that's a
supposition,
> not a question about what is in the document now.

That must mean I still don't have the correct term

I have not changed the subject here.  

{"a":"b"}\r\n

Is that legal and should it be legal - the current ABNF says yes.  What do
current parsers say?

> 
> 
> >>> This makes a difference with the argument about moving all of the
> >>> values
> >> to
> >>> the top level since then the string (ignore the quotes) "   true \r\n"
> >>> cannot be matched if you just want to say it is a Boolean literal
> >>> (i.e. the non-terminator true).  Instead you need to say that it can
> >>> have whitespace on either side of it.
> >>
> >> The current grammar does not allow whitespace around "true" for that
> >> boolean value.
> >
> > Actually it does, but the whitespace comes from the container it is in.
> 
> You have changed the subject of the question, then. You were asking about
> the top level, without a container. I claim my answer is correct for the
> question you asked.
> 
> > The
> > current grammar does not allow true at the top level and if that does
> > not change then the above remains a moot point.  Note that the text
> > was talking about moving all values to the top level.
> 
> None of the objects other than arrays and objects have optional
whitespace.
> None.
> 
> > Yes -but what I am saying is that there are (probably) parsers which
> > stop before the string has been fully consumed.  Thus they would
> > accept the string as valid.
> 
> There are (probably) parsers that do all sorts of stupid, non-conformant
> things. Why is that relevant here?

We made some explicit decisions in the JOSE working group based on some of
the above issues.  I was just verifying that we had the correct assumptions
in making those decisions.

> 
> --Paul Hoffman=