jsonvalidate
jsonvalidate copied to clipboard
Detect and reject trailing commas
They are not valid JSON and so should not be permitted. jsonlite doesn't care, and nor does passing them directly through to V8
Can you let a little bit more clear? Has some example?
Trailing commas in arrays or objects are valid JavaScript but not valid JSON. For example:
[1, 2, ]
and
{
"a": 1,
"b": 2,
}
are not valid json (https://jsonlint.com) but can be passed into jsonvalidate because it never actually parses inputs as json