Re: [Json] Leading and trailing whitespace

Carsten Bormann <> Tue, 11 June 2013 16:16 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id D06E621F8F9E for <>; Tue, 11 Jun 2013 09:16:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.147
X-Spam-Status: No, score=-106.147 tagged_above=-999 required=5 tests=[AWL=0.102, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Ygr+WPsP-RFc for <>; Tue, 11 Jun 2013 09:16:47 -0700 (PDT)
Received: from ( [IPv6:2001:638:708:30c9::12]) by (Postfix) with ESMTP id 5B32D21F9634 for <>; Tue, 11 Jun 2013 09:16:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
Received: from ( []) by (8.14.4/8.14.4) with ESMTP id r5BGGfBN022471; Tue, 11 Jun 2013 18:16:41 +0200 (CEST)
Received: from [] ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 1AA433608; Tue, 11 Jun 2013 18:16:41 +0200 (CEST)
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Content-Type: text/plain; charset=iso-8859-1
From: Carsten Bormann <>
In-Reply-To: <>
Date: Tue, 11 Jun 2013 18:16:40 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <06c101ce6625$0f891bf0$2e9b53d0$> <> <06e901ce6638$e8f27a90$bad76fb0$> <> <070b01ce664b$e5e0ac10$b1a20430$> <> <> <> <>
To: Paul Hoffman <>
X-Mailer: Apple Mail (2.1508)
Subject: Re: [Json] Leading and trailing whitespace
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 11 Jun 2013 16:16:52 -0000

On Jun 11, 2013, at 18:06, Paul Hoffman <> wrote:

>> So we will have to add a production:
>> 	JSON-value = ws value ws
>> That didn't seem too hard.
> Question: are you saying we should do that even if we don't allow all values at the top level, or only if we add them at the top level?

This production does not have any effect unless we use it.
The radical proposal is to replace the top-level JSON-text with it, or

JSON-text = ws value ws

My less radical, but somewhat questionable proposal is to use it as a second "top-level", i.e., keep 
JSON-text as is as the basis for application/json and the +json media types, and add application/json-value referencing this new production.

The less radical proposal is somewhat questionable because it is very likely that people will keep sending around JSON-value representations with a application/json media type even it is clarified that this one is JSON-text only.  On the other hand I haven't seen too many documented cases of that, so maybe it is not that much of a problem.  Clearly, some thinking would need to go into how +json would handle the desire for isolated atomic JSON values.  And, some phrases as in "send it to me in JSON" would need some recalibration, because it is no longer clear which variant is needed.  (Arguably, that hasn't really been clear for a while.)

Grüße, Carsten