express-joi-validation icon indicating copy to clipboard operation
express-joi-validation copied to clipboard

creates a validator that generates middlewares using async

Open ianriizky opened this issue 1 year ago • 2 comments

As Joi has a feature to run validate in asynchronous way here, I create this PR to serve that ini this repository.

ianriizky avatar Nov 23 '23 13:11 ianriizky

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?

evanshortiss avatar Nov 24 '23 15:11 evanshortiss

  • 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 🙌

ianriizky avatar Nov 24 '23 16:11 ianriizky