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

Adds jsonStrict option #74

Merged
merged 4 commits into from Jun 4, 2018
Merged

Adds jsonStrict option #74

merged 4 commits into from Jun 4, 2018

Conversation

ErikAugust
Copy link
Contributor

Adds a jsonStrict option that can be passed to co-body for JSON parsing. By default (true), co-body only allows arrays and objects. This allows us to pass false, which allows for all types (such as string literal, etc.)

Adds usage information on 'jsonStrict' option
@MarkHerhold
Copy link
Contributor

@ErikAugust Thanks for this! Other than a missing typescript definition, this looks good.

Out of curiosity, did you have a specific reason for wanting to allow parsing "non-strict" JSON?

@ErikAugust
Copy link
Contributor Author

@MarkHerhold Awesome - the reason is rewriting a legacy REST API endpoint that needed a non-strict response :)

@MarkHerhold MarkHerhold merged commit 50d6699 into koajs:master Jun 4, 2018
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.

None yet

2 participants