queson

QUESON

QUEry, URL-Encodable ECMAScript Object Notation

Online live compiler | Implementations


QUESON is a URL-friendly alternative notation for JSON.

This JSON:

{
  "Hello!": ["It looks", "like this."],
  "Kind of weird": {
    "but better than": "the alternative!"  
  }
}

which minified and URL-encoded looks like this:

%7B%22Hello%21%22%3A%5B%22It%20looks%22%2C%22like%20this.%22%5D%2C%22Kind%20of%20weird%22%3A%7B%22but%20better%20than%22%3A%22the%20alternative%21%22%7D%7D

in QUESON, looks like this instead:

X.w.Hello!.w-I.w.It_looks.w_w.like_this...w.I_w.Kind_of_weird.w-X.w.but_better_than.w-w.the_alternative!.w.X.X

Implementations

Specification

There’s a PEG.js grammar that produces a JSON string that serves as spec:

queson2json.pegjs

Design and alternatives

There are multiple alternatives for URL-friendly JSON representations:

QUESON is different because: