RFC 7464 / START HERE
JSON Text Sequences, before the details
JSON means JavaScript Object Notation. A text sequence is a series of separately framed JSON values.
JSON Text Sequences carries a series of JSON values using UTF-8 bytes. A record separator begins each value, and an encoder adds a line feed after it. The sequence is not itself a single JSON document.
The idea in one picture
Encode one JSON value
Add RS and LF framing
Process records incrementally
A simplified picture of the idea; the chapters explain the actual mechanisms.
Why it exists
Logs and growing datasets can be processed one record at a time without waiting for one huge array. The format also lets a parser find the next record boundary after damaged data.
A familiar example
A fictional log writes {"n":1}, then {"n":2}, each with its own framing. Recovery can lose records, and the format provides no cryptographic integrity protection. It is more than simply putting one JSON value on each line.
Helpful background
You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.
What you’ll learn next
Begin with chapter one, or choose a topic.
- Frame each JSON textA sequence encoder surrounds each UTF-8 JSON text with a record separator before it and a line feed after it.→
- Recognize an unambiguous boundaryAn actual RS byte begins a record; an escaped RS inside a JSON string remains ordinary string data.→
- Recover after a damaged recordA damaged candidate need not end the sequence: a parser should continue at the next record separator.→
- Detect possibly truncated scalarsNumbers, true, false and null need trailing JSON whitespace so a parser can reject potentially truncated values.→
- Keep recovery separate from trustDifferent parsing strategies can expose different results; record framing provides no cryptographic integrity.→
This introduction explains RFC 7464 (2015). Read the original RFC ↗