-
Notifications
You must be signed in to change notification settings - Fork 368
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
Named predefined params #23
Comments
@rodrigok Do you have more information on exactly what you're trying to achieve? From your example, I don't know why you couldn't just do |
Yes, sorry. I'm trying to validate params to only accept hexadecimal characters using a predefined "type" called objectId. Exists an example at express website (http://expressjs.com/4x/api.html#app.param) that allow pass regexp to validate params by param's name. My proposal is find some way to allow to validate params via an type and not via param's name, some thing like this. It's just an idea and will help-me a lot. Thanks. |
Ok, I think I understand now. You're after the ability to do aliases for the purpose of param validation. There are a couple of reasons I think this is a bad idea.
Feel free to reopen if you disagree or comment if it still doesn't make a ton of sense. |
Ok, I understand your points. Thanks for your attention. |
Original issue: expressjs/express#2127
Using this code from doc
I can use named params with regex match, but I can't use this param more than 1 time and generic names make the url a little messy.
I can't do this
There are some way to name this params like below?
The text was updated successfully, but these errors were encountered: