Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To expand on that: only since RFC 7158, earlier versions required the root to be an array or object.

So if you're generating json, it's advisable to wrap it so that parsers written according to the older specs won't choke on it.

However, when parsing, like this, you want to try and accept values.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: