-
Notifications
You must be signed in to change notification settings - Fork 92
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
Reason for creating this library? #10
Comments
Promises API wasn't the main reason although I quite like to have it this way. Main reason was that I made some quick tests about the other implementations and realized that no-one had something like At first I thought of making a pull request for an existing implementation but then I found myself with quite a lot of free time so I've decided to read JSON schema specification word by word and implement it the way I like it to be. It might not be the fastest implementation out there, but it's fast enough in cases where I use it (certainly not a bottleneck thing). It's also covering a huge amount of tests (https://github.com/json-schema/JSON-Schema-Test-Suite) and I'll definitely try to fix all the bugs the people can find. |
Thank you, for that detailed explanation! It helps me a lot. If z-schema supports schema compilation but is not the fastest, what's the reason of schema compilation, and why are other libraries without schema compilation faster than z-schema? |
I haven't said its not the fastest, I never did any tests for speed and it would be quite hard to effectively compare async implementation vs sync one. This implementation is focused on features rather than speed. Goal of schema compilation is mainly to download remote schemas that are references by your schema. See this test for example https://github.com/json-schema/JSON-Schema-Test-Suite/blob/develop/tests/draft4/refRemote.json It would not be possible to download remote references in sync implementation. Compilation is there so you don't download it over and over again when validating tons of objects against the same schema. |
Let's leave it open if others had the same questions as you did ;-) |
I put together some performance benchmarks, results are currently like this:
|
@zaggino Also, it seems that your module is one of the few that populates defaults in the resulting objecting. However, I don't see a test for that — is that the case? |
Does it? I don't think so. But support for this (and any other fully customizable behaviour) is planned soon in #24 |
Performance benchmarks are available here: |
thanks @zaggino great library. |
FYI version 3.x will be a complete rewrite of everything done here (all tests and features will be of course migrated), so far it's looking good: https://rawgit.com/zaggino/z-schema-3/master/benchmark/results.html |
I'd like to know why development of this library was started although there are JSON schema validation libraries out there? What are the features of this library which make z-schema different from other libraries (i.e. natesilva/jayschema)? Is it the Promises/A+ based API?
The text was updated successfully, but these errors were encountered: