Closed Rage2010 closed 7 years ago
The issue here is the trailing commas rather than the boolean literals. This is not valid JSON and so the parser fails to read it and can not prettify it. linter-jsonlint
is a good way to avoid issues like this as it will automatically highlight syntax issues in JSON for you.
Actually I made an error when stripping other data to make the sample. But the error seems to be the encoding of the generated file and not related to pretty-json.
Trying to prettify a json fixture generated by django (from python manage.py dumpdata) will fail if the data contains boolean value.
Example that will fail: [{ "model": "app1.model1", "pk": 1, "fields": { "name": "data1", "is_new": true, } }, { "model": "app1.model1", "pk": 2, "fields": { "name": "data2", "is_new": false, } }]