-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add "types" to path matchers #13
Comments
Copied from deprecate/metal-router#24 by @jbalsas Hey @mthadley, this does indeed seem interesting, but I haven't been able to find a similar approach out there int he wild. All of them seem to just rely on regexes for this. I'd be more comfortable if there is already a pattern for this out there, so we don't need to come up with our own format. Do you know of any such cases? |
Copied from deprecate/metal-router#24 (comment) by @mthadley @jbalsas Yea! So Django recently added something like this. Check it out here. |
Copied from deprecate/metal-router#24 (comment) by @Robert-Frampton This would actually mean changing Senna and https://github.com/metal/metal-path-parser. @brunobasto, what are your thoughts on this behavior for the Senna |
Hey guys, I might have missed this thread. I like the idea. If everyone agrees, we can try to add support for it. We should probably do it in way that's backwards compatible thought. |
Copied from deprecate/metal-router#24 by @mthadley
Hey everyone, I wanted to throw out a quick idea that may reduce some of the boilerplate when defining our routes.
It's pretty common to define a route like this, possibly many times, that is meant to match some kind of
number
:After a while, it get's tedious to add these regexes to our routes, and also reduces readability. Maybe instead we could still allow for a regex, but also provide some default "types":
The syntax is subject to change, but I think it would at least be useful for parsing numbers. Possible other things like booleans as well.
Thanks!
The text was updated successfully, but these errors were encountered: