-
Notifications
You must be signed in to change notification settings - Fork 137
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 ValidParser #68
base: master
Are you sure you want to change the base?
Add ValidParser #68
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #68 +/- ##
==========================================
+ Coverage 97.11% 97.77% +0.66%
==========================================
Files 9 11 +2
Lines 1073 1306 +233
==========================================
+ Hits 1042 1277 +235
+ Misses 22 21 -1
+ Partials 9 8 -1 ☔ View full report in Codecov by Sentry. |
I, too, do not enjoy needing two calls for peace-of-mind that my JSON will not break once I start processing it. This would be super handy to have merged into the library, and the PR looks well-tested and benchmarked. @valyala, is there some hesitation with this feature which has left it in limbo for so long? If not, I think a lot of people would appreciate being able to avoid separate invocations. 🙏 |
I've updated the symbol names. |
Presently, users that want to validate their json before parsing need to run
Validate
andParse
separately.This is inefficient because each json string must be scanned twice.
This PR introduces a
ValidParser
which validates as it parses.It is slightly less efficient than the normal parser, but much more efficient than running
Validate
andParse
separately.Adds 7 new symbols to the API:
See #58