JavaScript Object Notation (JSON) Text Sequences
RFC 7464
Internet Engineering Task Force (IETF) N. Williams
Request for Comments: 7464 Cryptonector
Category: Standards Track February 2015
ISSN: 2070-1721
JavaScript Object Notation (JSON) Text Sequences
Abstract
This document describes the JavaScript Object Notation (JSON) text
sequence format and associated media type "application/json-seq". A
JSON text sequence consists of any number of JSON texts, all encoded
in UTF-8, each prefixed by an ASCII Record Separator (0x1E), and each
ending with an ASCII Line Feed character (0x0A).
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc7464.
Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Williams Standards Track [Page 1]
RFC 7464 JSON Text Sequences February 2015
Table of Contents
1. Introduction and Motivation .....................................2
1.1. Conventions Used in This Document ..........................2
2. JSON Text Sequence Format .......................................3
2.1. JSON Text Sequence Parsing .................................3
2.2. JSON Text Sequence Encoding ................................4
2.3. Incomplete/Invalid JSON Texts Need Not Be Fatal ............4
2.4. Top-Level Values: numbers, true, false, and null ...........5
3. Security Considerations .........................................6
4. IANA Considerations .............................................6
5. Normative References ............................................7
Acknowledgements ...................................................8
Author's Address ...................................................8
1. Introduction and Motivation
The JavaScript Object Notation (JSON) [RFC7159] is a very handy
serialization format. However, when serializing a large sequence of
values as an array, or a possibly indeterminate-length or never-
ending sequence of values, JSON becomes difficult to work with.
Consider a sequence of one million values, each possibly one kilobyte
when encoded -- roughly one gigabyte. It is often desirable to
process such a dataset in an incremental manner without having to
first read all of it before beginning to produce results.
Traditionally, the way to do this with JSON is to use a "streaming"
parser, but these are not widely available, widely used, or easy to
use.
This document describes the concept and format of "JSON text
sequences", which are specifically not JSON texts themselves but are
composed of (possible) JSON texts. JSON text sequences can be parsed
(and produced) incrementally without having to have a streaming
parser (nor streaming encoder).
1.1. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[RFC2119].
Williams Standards Track [Page 2]
RFC 7464 JSON Text Sequences February 2015
2. JSON Text Sequence Format
Two different sets of ABNF rules are provided for the definition of
JSON text sequences: one for parsers and one for encoders. Having
two different sets of rules permits recovery by parsers from
sequences where some of the elements are truncated for whatever
reason. The syntax for parsers is specified in terms of octet
strings that are then interpreted as JSON texts, if possible. The
syntax for encoders, on the other hand, assumes that sequence
elements are not truncated.
JSON text sequences MUST use UTF-8 encoding; other encodings of JSON
Show full document text