Hacker News API doesn't obey RFC 4627
Normally, I would post this on the github issue tracker, but it does not exist. See https://github.com/HackerNews/API.
The API returns "null" when an "Item" doesn't exist.
Example: https://hacker-news.firebaseio.com/v0/item/1607092358902384905.json?print=pretty
RFC 4627 specifies that the returned JSON must be either an object or an array. This is neither. Please help. Thank you.
Suggestion: Instead of "null", can you make it"{ \"item\" : null }" ?
Warmest Regards
12 comments
[ 4.8 ms ] story [ 47.7 ms ] threadper the RFC,
"JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays)."
"An object is an unordered collection of zero or more name/value pairs, where a name is a string and a value is a string, number, boolean, null, object, or array."
2.1. Values
... so what you're receiving is technically a valid JSON value according to the RFC, no?(I am so sorry for being this pedantic - but that RFC is marked 'informational', it's not actually a standard so much as a suggestion, and even worse, RFC 7159 obsoletes it and is an IETF standards track document - check out http://tools.ietf.org/html/rfc7159. The ambiguity is definitely removed in the updated version.)
vs
null
I'm pretty sure they're both valid.
The URI exists, the requested record/document does not, hence the successful response with no return.
Entire item: https://hacker-news.firebaseio.com/v0/item/8422599.json
Just one property: https://hacker-news.firebaseio.com/v0/item/8422599/kids.json
Also, please send API correspondence to api@ycombinator.com.