Re: Gen-ART and OPS-Dir review of draft-ietf-json-text-sequence-09

Nico Williams <> Tue, 09 December 2014 17:18 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id B1AB41A89A4; Tue, 9 Dec 2014 09:18:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.666
X-Spam-Status: No, score=-1.666 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id pNmQZOawagkm; Tue, 9 Dec 2014 09:18:42 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 5CB381A8984; Tue, 9 Dec 2014 09:17:30 -0800 (PST)
Received: from (localhost []) by (Postfix) with ESMTP id 3927F20046B15; Tue, 9 Dec 2014 09:17:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to;; bh=4pfVbFRe6rXtQ1 hTscWy8uJnYcY=; b=K1knMO/JW/yJEKIhl2Nlv9H+/uACtSw72vLz2yEDEdhUZn ohzTPdpIORzXoSy3uXcMpoKReoQ9vUajKfXeCk1AKVJUd6oGrANxe1DWH5hqYrxR O9IT4q8xEmlQwirMyIcv63p/wsipCCGODbJPDI9WXFa0Qi2zi3yM9Es4JRLV8=
Received: from localhost ( []) (Authenticated sender: by (Postfix) with ESMTPA id B05792004692F; Tue, 9 Dec 2014 09:17:29 -0800 (PST)
Date: Tue, 9 Dec 2014 11:17:29 -0600
From: Nico Williams <>
To: "Black, David" <>
Subject: Re: Gen-ART and OPS-Dir review of draft-ietf-json-text-sequence-09
Message-ID: <20141209171724.GB12979@localhost>
References: <> <20141209041937.GD11221@localhost> <>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "General Area Review Team \(\)" <>, "" <>, "" <>, "" <>
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF-Discussion <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 09 Dec 2014 17:18:43 -0000

On Tue, Dec 09, 2014 at 04:41:12PM +0000, Black, David wrote:
> [A] JSON text parse failures
> > [...]
> Your alternative wording "whenever the JSON text parse fails, ..." is fine.


> [D] Truncation
> > A missing terminating LF is not a problem for strings, arrays, or
> > objects.  I seem to recall that we did discuss this.  We could require
> > that such texts fail to parse, but perhaps the more important thing is
> > to require common parser behavior as to such truncations.
> > 
> > You ABNF proposal is certainly more strict than the one in the I-D.  I'm
> > neutral as to whether this form or the one in the I-D (with the ws issue
> > fixed) is better.  The stricter form is clearly easier to talk about,
> > therefore preferable, but it will mean discarding texts where only that
> > terminating LF is truncated.
> I concur with both of the above paragraphs - my preference is to detect
> incomplete JSON texts at the sequence level via the missing LF rather than
> special-casing numbers and relying on failed JSON parses for everything else.
> In general, earlier detection of errors increases the options for dealing
> with them.

And, of course, a streaming/incremental parsers might well output all
there is to output when only the last LF is missing but the top-level
value was properly delimited anyways.  So it's kinda difficult to get a
fool-proof requirement that the trailing LF must be present.

Your review comments included adding this note about incremental
parsing.  There's a conflict here between the two comments that had not
been apparent to me last night.  I now think that fixing the ws problem
is the best way forward.

> Once the incomplete text is detected, a JSON parse could be attempted,
> with the JSON parser knowing that the text is incomplete (e.g., text
> may fail to parse, a number at the end of the text must not be produced
> as an incremental parse result).

That's so for non-incremental parsers.  (Or when buffering the complete
text instead of handling incrementally, even though one has an
incremental parser.)

Consider one implementation I'm familiar with.  Its JSON text parser is
incremental (but not streaming), so it produces outputs with no need for
extra whitespace when the input text is a string, array, or object, but
for top-level numbers, booleans, and null, it needs to either read one
more byte or reach EOF before it will output them.

So I think we really do need to say something about top-level numbers
(and true, false, and null), namely: that they must be delimited by
whitespace, that '<RS>1234<RS>' is not a valid sequence element because
the number may have been truncated.  (Ditto '<RS>true<RS>', since the
intended text could have been 'trueish', which is invalid of course, but

> As for RFC 20 ...
> > Is this resolved by now?  I can always reference only Unicode.
> Keep the RFC 20 reference - I have no problem with it.  Moreover, as a
> result of all the hubbub around this nit, the IESG has issued a Last Call
> to reclassify RFC 20 as an Internet Standard ... so that this never
> arises again ...

Yes, I noticed.  I expect the IETF LC will pass for that.