Joi: Support for http://json-schema.org/ and performance

Created on 7 Feb 2014  路  3Comments  路  Source: sideway/joi

I just read an interesting blog post http://cosmicrealms.com/blog/2014/02/07/benchmark-of-node-dot-js-json-validation-modules-part-2/

Which has joi running as one of the slower candidates and also calls out joi for not supporting json-schema.org.

Was wondering your thoughts.

support

Most helpful comment

I've been working on a json-schema to joi schema utility with the intended purpose of something like input validation for swagger schemas or otherwise..

Joi is actually a lot faster, from what I can tell, than any json schema validator. I question the above blog's benchmark and wonder if they were creating the joi schema as part of the iteration (which would be slower than creating it as setup).

Anyway, here is a link: https://github.com/tlivings/enjoi

All 3 comments

Thanks for the link. It's nice to see people include joi in their tests.

On performance, we have not seen it as an issue. If it is, we can look where we can optimize. But it is really designed for ease of use above most other things. Also see https://github.com/spumko/hapi/issues/1326.

On json-schema - we don't like it. It is hard to read, write, and maintain. It also doesn't support some of the relationships joi supports. We have no intention of supporting it. However, hapi will soon allow you to use whatever you want.

Many thanks for the rapid response. I'm constantly impressed by how fast you engage with the community around hapi (as well as being impressed by hapi itself), so thank you again.

The change in hapi to support custom validation tools would be very interesting. I will keep my eye out for it in the roadmap / release notes.

I've been working on a json-schema to joi schema utility with the intended purpose of something like input validation for swagger schemas or otherwise..

Joi is actually a lot faster, from what I can tell, than any json schema validator. I question the above blog's benchmark and wonder if they were creating the joi schema as part of the iteration (which would be slower than creating it as setup).

Anyway, here is a link: https://github.com/tlivings/enjoi

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesdixon picture jamesdixon  路  4Comments

normancarcamo picture normancarcamo  路  3Comments

builtbybrayne picture builtbybrayne  路  4Comments

kailashyogeshwar85 picture kailashyogeshwar85  路  4Comments

ashrafkm picture ashrafkm  路  3Comments