GraftJS / graft

full-stack javascript through microservices
http://graft.io
MIT License
227 stars 15 forks source link

Validation as a uService #16

Open mcollina opened 10 years ago

mcollina commented 10 years ago

I think we might want to provide a validation-as-a-microservice module, based around Joi.

What do you think? I'm placing it here just because it's a place...

It should be kind-of compatible with https://github.com/GraftJS/graft-http/issues/1.

tamagokun commented 10 years ago

I've seen this before and find it useful. You specify a schema in your micro service, and it can run validation on the message before reaching the micro service. To make it compatible with graft-http you validate against GET or POST vars.

mcollina commented 10 years ago

Yes. I think it should be generic and configurable, so that it's not completely HTTP-specific.

AdrianRossouw commented 10 years ago

I find json-schema is pretty good for this kind of thing.

I recommend tv4 as the best of the validators i have used.

AdrianRossouw commented 10 years ago

@mcollina any reason for joi specifically?