-
Notifications
You must be signed in to change notification settings - Fork 96
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: Allow multiple types #74
Comments
Thinking about it, why is it even relevant in which format the clients sends the data? If this middleware can decode it and provide it as structured data in the body then the route should not dictate a singular format. What do you think? |
I went ahead and implemented this on my fork of the project: https://github.com/Saghen/joi-router Please note though that this fork is currently a heavy wip. |
👍 Which commit brought that feature into your fork? |
A goal of this module is to fail as fast as possible on invalid input. No guessing means less bugs in my APIs. Accepting multiple formats by using an array seems like a good idea. |
Any updates on the issue? |
It seems it would make sense to allow clients to request resources with either json, url encoded or form data. All three could be allowed by the API.
Currently the
type
argument in the validation is only accepting a string.I could create a PR that would accept an array too.
The text was updated successfully, but these errors were encountered: