Skip to main content

Whether a text is a JSON object or array, and how a list of JSON records is sent as one array.

A text is read leniently: unquoted and single-quoted names and values, ; between members, and trailing, empty and leading commas are taken, and whatever follows the outermost object or array is ignored. A name twice in one object is not taken. Only whether the text parses is answered.

The parse keeps its own stack, so it has no limit on nesting depth.

Functions

Whether text parses as a JSON object, read leniently (see the module docs).
Whether text parses as a JSON array, read leniently (see the module docs).
Whether every text parses as a JSON object, as is_valid_json answers.
The records, each already JSON, joined with commas inside brackets, as they are without checking them.