[Json] discoverability of separators in draft-ietf-json-text-sequence

"Joe Hildebrand (jhildebr)" <jhildebr@cisco.com> Mon, 04 August 2014 19:23 UTC

Return-Path: <jhildebr@cisco.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 AA3891A0295 for <json@ietfa.amsl.com>; Mon, 4 Aug 2014 12:23:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.502
X-Spam-Level:
X-Spam-Status: No, score=-14.502 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham
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 tHZfQw99vYh2 for <json@ietfa.amsl.com>; Mon, 4 Aug 2014 12:23:42 -0700 (PDT)
Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 045DE1A0294 for <json@ietf.org>; Mon, 4 Aug 2014 12:23:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1790; q=dns/txt; s=iport; t=1407180222; x=1408389822; h=from:to:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=eKaUMnkikHsyCY2wbWEQBw18n17vW4pS9KoWMUVkF2o=; b=G1/ozhfSlUzob5tRvDZ9KC3smIkbQXxNWBTUpdyZ4EUKKM24Psn0BMjs FX2XMYhaeGm3Lw9vrNtgQJabo7Kro8dKeEpUvmdErWcWr4htm5J4xdhWm Cw6L7ujWW/u8M40rxEzM56gAkbOFSWzDzaOCGIagz4WOQpRWYaEKormV/ g=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhgFACnd31OtJV2S/2dsb2JhbABbgw2BLYJ0zXaDGxp4FneECiMRVwEiAiYCBDAVEgSIVZ4hjyuXFxeBLI4FgxuBUgWcBpRfg02CMg
X-IronPort-AV: E=Sophos;i="5.01,799,1400025600"; d="scan'208";a="345028562"
Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by rcdn-iport-3.cisco.com with ESMTP; 04 Aug 2014 19:23:41 +0000
Received: from xhc-rcd-x09.cisco.com (xhc-rcd-x09.cisco.com [173.37.183.83]) by rcdn-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id s74JNf7Z031048 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for <json@ietf.org>; Mon, 4 Aug 2014 19:23:41 GMT
Received: from xmb-rcd-x10.cisco.com ([169.254.15.102]) by xhc-rcd-x09.cisco.com ([173.37.183.83]) with mapi id 14.03.0123.003; Mon, 4 Aug 2014 14:23:41 -0500
From: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
To: "json@ietf.org" <json@ietf.org>
Thread-Topic: discoverability of separators in draft-ietf-json-text-sequence
Thread-Index: AQHPsBmYmm/28gTeik2CkWeDK296Hw==
Date: Mon, 04 Aug 2014 19:23:40 +0000
Message-ID: <D00531D3.58056%jhildebr@cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.4.3.140616
x-originating-ip: [10.129.24.242]
Content-Type: text/plain; charset="utf-8"
Content-ID: <5E01FDFB8A54C448B668565AE3B6A49F@emea.cisco.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/json/XRqOi19pSsJCW3Rk0GrO-i4wnrQ
Subject: [Json] discoverability of separators in 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: Mon, 04 Aug 2014 19:23:43 -0000

What if you could use basically any separator you wanted in a text
sequence, every sequence MUST start with that separator, and we gave
suggestions for ones we think would work with some text about the
trade-offs?

Processors would read up to the first [, {, ", n, t, f, ., -, or number,
and treat that as the separator (potentially ignoring an irrational BOM if
they like).  The separator MUST be escaped in any of the JSON texts in the
sequence.  Whenever the separator is read, a new JSON text starts
immediately after it.  Any pending text that was not (yet) a valid JSON
text that was waiting to be processed when the separator is encountered
signifies a write error, and MAY be ignored.  Whitespace could trail a
JSON text before the next separator, which could be ignored according to
the previous rule.

ABNF such as:

JSON-sequence = *(sep value ignorable-ws)
sep = 1*(not [{"ntf.-0123456789)
ignorable-ws = ws
ws = <given by RFC7159>
     value = <given by RFC7159>

The other syntactically valid characters in a JSON text should probably be
forbidden in a separator as well.

Alternately, we could decide that the separator was always exactly one
byte, but keep everything else the same as above, simplifying the
processors a good amount.


-- 
Joe Hildebrand