{ "JSONT": "JSON × Trailing Commas",
  "extends": "JSON with Comments",
  /* JSONT Specification */ }

NOTICE: This is a draft of the JSONT Specification and is subject to change.

Summary

JSONT (JSON with Trailing commas) is an extension of JSONC (JSON with Comments) that explicitly allows trailing commas within JSON (JavaScript Object Notation) data. This specification defines the syntax and semantics of JSONT.

Syntax

JSONT follows all the syntax rules of JSON and JSONC, with the addition of trailing commas in arrays and objects.

Trailing commas in Arrays

{
  // Trailing comma after the last item in an array is allowed
  "array": [
    "item1",
    "item2",
    "item3",
  ]
}

Trailing commas in Objects

{
  "object": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3",
    /* Trailing comma after the last key-value pair in an object is allowed */
  }
}

File extensions

The recommended file extension for JSONT files is .jsont.

The extension .json should be avoided, as it supports neither comments nor trailing commas. Similarly, .jsonc is not recommended because it does not support trailing commas (although many jsonc parsers can be configured to support trailing commas).

Tools and Libraries

While JSONT is not widely recognized as a standard format, many JSON and JSONC parsers can be configured to support trailing commas.

Here's a non-exhaustive list:

Main Use Cases