-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Change JSONSchema validator from is-my-json-valid to ajv #397
Conversation
Hi @rybaczewa thank you for the great PR.
before:
- disc: 408.9kB
- gzip: 156.8kB
after:
- disc: 489.6kB
- gzip: 174.3kB
I think we should not swap out the default validator by now. It will be better to create a new plugin |
If it comes to Build size increase sounds about right looking at package sizes: Generally speaking, the more I looked at old validator package, the less I liked it. Separate validator seems OK for now, but it might more beneficial for the future to migrate to package that does it's job. I am by no means pushing exactly ajv, just anything that works (and it's looking like the best choice for now). |
You are right. I currently also regret the switch to is-my-json-valid and we should move to ajv in the future. |
Closed in favor of 20063b960ba87e9a7a561f45d56271aafef6a42e |
Hi @rybaczewa
Yes, ajv is more compliant with the json-schema-standard, but I do currently not think that this is worth the disadvantages. Any comment or argument would be welcomed. |
This PR contains:
Potentially breaking change, few new tests, package change
Describe the problem you have without this PR
At the moment, is-my-json-valid is not validating schemas with definitions properly. It causes invalid schemas to pass validation where it shouldn't. Ajv is faster and better maintained, much better coming into the future of the project.
Extra parsing function added for backward compatibility of errors.