Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add null as acceptable json #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add null as acceptable json #2

wants to merge 1 commit into from

Conversation

fl0w
Copy link

@fl0w fl0w commented Jul 24, 2017

@fardelian
Copy link

false, 0 and "" (empty string) are also valid JSON but this function will fail to validate them.

@fl0w
Copy link
Author

fl0w commented Aug 1, 2017

@fardelian this was specifically for a feature request in Koa (referenced in original comment). Not sure it's supposed to pass all those.

@fardelian
Copy link

@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.

@fl0w
Copy link
Author

fl0w commented Aug 1, 2017

@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.

@damianobarbati
Copy link

@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.

@jonathanong
Copy link
Member

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

@3imed-jaberi
Copy link
Member

@jonathanong, please close this PR and merge/close all other PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants