Skip to content
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

Feature Request. Validate multiple container types all at once #41

Open
windward-hive opened this issue Jul 27, 2022 · 3 comments
Open

Comments

@windward-hive
Copy link

It would be nice to have something like validator.multiple to validate multiple container types all at once rather than having to create a new middleware for each container type.

validator.multiple({
	body: validator.body(),
	params: validator.params(),
	query: validator.params
});
@evanshortiss
Copy link
Owner

@maybesmurf this could be supported, but the reason I didn't do so is because I wanted to allow a developer to choose the validation order.

Supporting a validator.multiple() is possible, but it would need to use a predefined validation order, e.g headers => query => body, or similar.

I'm not sure what benefit it will provide. WDYT?

@mattiamalonni
Copy link

I was interested in the same functionality and ended up writing a new package. For anyone interested: https://github.com/mattiamalonni/express-joi-validations

@evanshortiss
Copy link
Owner

@mattiamalonni I asked in another PR/Issue on this repository if anyone wants to take over as maintainer. If you want, I can add you, and you can implement these changes here. Up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants