josephburnett / jd

JSON diff and patch
MIT License
826 stars 38 forks source link

add line/column number to syntax errors #69

Open mark-pictor-csec opened 6 months ago

mark-pictor-csec commented 6 months ago

I can use other tools to track down an error, but it'd be nice if jd could provide the location itself.

compare jd's behavior with a bad file with that of jq:

$ jd defsck_p.json defsck_f.json           
2024/02/23 15:32:17 invalid character '(' in string escape code

$ jq <defsck_p.json 
parse error: Invalid escape at line 49883, column 1295
josephburnett commented 1 month ago

This is a limitation of Golang's bulitin JSON parser. Maybe there is a better one that can give that kind of specific error. Would be really nice for sure!