←back to thread

Fixing JSON

(www.tbray.org)
139 points robin_reala | 2 comments | | HN request time: 0.438s | source
Show context
adrianratnapala ◴[] No.12329791[source]
I agree with those who say JSON should never change, but should one day be replaced. It behooves us to think about what that replacement should be.

My own peeves:

* Numbers are stored in decimal but usually interpreted as binary with no guidance about rounding.

* The concatenation of valid JSON blobs is never valid JSON.

* The empty string is not valid JSON.

The last two can be "fixed" by a format called "arraySON" where the global blob represents not a JSON object (dictionary), but the contents of an array plus an optional trailing comma.

Or given some of the ideas on this thread, perhaps a manadatory leading comma.

replies(2): >>12329853 #>>12330356 #
1. JimDabell ◴[] No.12330356[source]
> * The concatenation of valid JSON blobs is never valid JSON.

You might want to check out JSON Lines:

http://jsonlines.org/

replies(1): >>12331681 #
2. adrianratnapala ◴[] No.12331681[source]
Is there are formal defintion of the format anywhere?