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

feat: replace jsonlint with json-parse-helpfulerror #109

Merged
merged 1 commit into from
Dec 10, 2018
Merged

feat: replace jsonlint with json-parse-helpfulerror #109

merged 1 commit into from
Dec 10, 2018

Conversation

abacaphiliac
Copy link
Contributor

jsonlint is unmaintained, and the fork referenced in gavel is not published.

my proposal is based on the pull request from @honzajavorek where jsonlint is replaced with json-parse-helpfulerror instead of parse-json. json-parse-helpfulerror appears to work in the browser as well as server.

#85

@honzajavorek
Copy link
Contributor

honzajavorek commented Dec 10, 2018

@abacaphiliac Wow! This would be awesome. BTW, credits for #85 belong to @lukateake #84 🙌

I'll review this ASAP. If we get this merged and do the release train up to Dredd, we could finally close #83 and to remove this whole section from Dredd's installation docs 🙏

Copy link
Contributor

@honzajavorek honzajavorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@validation.body.results.push message
else
try
JSON.parse @body
jph.parse @body
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case we're not handling the error, so I wonder whether using JSON.parse() wouldn't be faster 🤔

OTOH, it could bring inconsistencies in how Gavel parsers JSON and what it considers to be valid or not - not sure whether there are any discrepancies, but the probability is not low. I guess we're better safe using the same implementation everywhere.

@honzajavorek honzajavorek merged commit 276f518 into apiaryio:master Dec 10, 2018
@ApiaryBot
Copy link
Collaborator

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants