Conversation

0 is a valid JSON document.

JSON.parse("0")
0

1
0
0

@sayrer AFAIK the term "JSON document" has no official definition. However, the byte sequence 0x3,0x0 is a conforming JSON text.

1
0
0
@timbray @sayrer where do multi-document formats such as CBOR, YAML and JSONL (json lines) fall in this?
2
0
1

@andy @timbray there is a lament by TBL himself that two XML documents concatenated are not an XML document. But I think it's OK. If you follow RFC 9839, you can put those control characters to good use, because they are clearly not part of the message. https://datatracker.ietf.org/doc/rfc9839/

0
0
1

@andy @sayrer Yeah, a JSON text is a single JSON "value" and an XML document is a single "element". In production doesn't seem to be a big problem. I mean, RSS isn't the only XML format that's basically a list of whatever. You can also argue that having an unambiguous end-of-list marker adds robustness.

Having said that, I use JLines all the time, particularly for benchmarking.

0
0
0