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
How to reuse a custom validation chain as router.use(xxxValidator)
#1173
Comments
Hey. Looks like a mismatch between express and express-validator. thanks for raising! |
Are you also able to come up with a small, contained replication repo? But it doesn't happen in any other environment, and I can't pinpoint the exact versions that cause the problem. |
Sorry for the late reply I made a simple example to reproduce here: https://codesandbox.io/s/gallant-violet-e181qx?file=/src/index.ts |
Hey @convers39, I was taking a look at this, it seems all is fine? |
For example, I have a custom validator that consists of an array of validation:
Now in my
routers/routeA.js
file, I want to apply this validation to all routes in this namespace like this:Instead of this:
And of cause, this will not match the signature:
I understand it requires a
RequestHandler
to work, is there any workaround to apply a validation chain to multiple routes?The text was updated successfully, but these errors were encountered: