3 ms·
That would make fetching JSON data significantly more complicated. You'd need to write your fetch call to detect if the browser supports comments and commas in
by onion2k 6y ago
That would make fetching JSON data significantly more complicated. You'd need to write your fetch call to detect if the browser supports comments and commas in JSON, and then make the request to the server to ask for whichever variant the user's browser supports, presumably with a different Accept header. Users who haven't updated to a new version of the browser would still ask for the old JSON format, and users who have updated would ask for the newer version.
That would mean your API would need to serve different variants based on the Accept header, and your backend code would need to generate the two different variants.
And then you'd have to question if sending API responses with unused things like comments is actually a good idea given it's entirely wasted data in a production environment.
I suspect few people would use a newer JSON format until it's been available for a long time, and even then they wouldn't use it on big sites.
- jugg1es 6y agoyea but it would be cool if you could include comments, wouldn't it?