Permissive parsing of commas in human written JSON

Issue #78 resolved
James Powell repo owner created an issue

Missing commas (or an extra one at the end of a list) are very common human errors. Usually, these errors are in JSON formatted with new-lines. Adopt, on read:

  • comma can be missing if there is a LF/CR
  • extra comma at end of list (object/array) is ignored if it has a following LF/CR

This follows (roughly) specs like JSON5.

Comments (6)

  1. James Powell reporter

    Example of missing commas:

    [
      1
      2
      3
    ]
    

    And extra comma at end:

    [
      1,
      2,
      3,
    ]
    

  2. James Powell reporter
    • changed status to open

    Reopen. Issue with Inserting of items; adds a comma, so trailing comma becomes two commas, which is an error.

  3. James Powell reporter

    I had to redo the info collected by teh Find functions, so I could determine whether or not a comma needs adding on insert, or removing on delete

  4. Log in to comment