Hacker News new | ask | show | jobs
by peterkelly 3504 days ago
Please don't do things like this. It only encourages people to be lazy about producing conforming documents, and different parsers that try to compensate for syntax errors are going to do so in different ways. We learnt this the hard way with HTML.
2 comments

Exactly. When you design for sloppy inputs, you're vulnerable to malicious inputs.
I'm not quite seeing who you think would be encouraged here. Bad JSON output is usually created in a rush by someone who didn't test their output. It's unlikely that someone who does test their JSON output would become lazy because a few lenient parsers exist.
Once there are parsers accepting bad input, people will inevitably test with those parsers and assume their output is okay.