add null as acceptable json
https://github.com/koajs/koa/issues/998
false, 0 and "" (empty string) are also valid JSON but this function will fail to validate them.
@fardelian this was specifically for a feature request in Koa (referenced in original comment). Not sure it's supposed to pass all those.
@fl0w I still think you update the commit to support all the values. I got to this PR from that feature request but I'd consider it a bug report. The complete fix would be to support all those values.
@fardelian in that issue the consensus amongst Koa core members was to add null, and I needed this updated to complete a fix that specific Koa issue, not to make this spec compliant.
@fl0w why not adding false, "" and 0 as well? Someone may come across the same issue I'm having with null value in returning "" 0 or false . This way we can be sure koa is correctly returning any valid json value: up to the developer to properly handle it.
I think this should be an option. though these are valid JSON bodies, it doesn't make sense in the real world to send these as HTTP bodies
@jonathanong, please close this PR and merge/close all other PRs.