express-joi-validation
express-joi-validation copied to clipboard
creates a validator that generates middlewares using async
As Joi has a feature to run validate in asynchronous way here, I create this PR to serve that ini this repository.
Thanks @ianriizky, what is the benefit of running async? I assume the validation is still ultimately a blocking operation, so it's just deferred for a bit? Or is it to support use cases where a custom validations using Joi.extend
are necessary as described here?
Could you add some tests? Also I think the version should be 5.1.0?
- In my case, I'm using validateAsync to apply any.external() schema which is can be used to run custom rules. It can only be run with validateAsync.
- I'll fix the bump version ASAP, my mistake 😅.
- Unit testing with bump version changing will come after this.
Thanks @evanshortiss 🙌