-
Notifications
You must be signed in to change notification settings - Fork 34
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
The RouteCollector is unable to handle custom RouteSelectors #149
The RouteCollector is unable to handle custom RouteSelectors #149
Conversation
…oredRouteSelectors
Hi, Thank you for the pr. I think understand the problem, but maybe the underlying issue is not the trailing "/", but that it is not possible to add private routeSelectors to the "ignored"-set, i.e. if the "toString()" would return anything else than an empty string, this would then still cause a problem. I'm interested in hearing your thoughts though. |
Thanks for taking the time to look at this 🙇 You have a good point there about non-empty toString output.. I've seen this practice in many other frameworks that work with class references, and I did go looking to see if you had built that already. It would make it possible to fix this when it happens. The downside is that it's not obvious that the user of this lib has to do something, or what is needed. I think it makes sense to implement a String-based ignore in the short term, while we contemplate the possibility to add something more dev-ex-friendly in the long term. As to how to implement the string-based version without breaking backwards compatability.. |
I pushed an update with a naive implementation of having a string-version I always feel it's good to have something concrete to share/talk about =) By no means see this as a push to have this swim-laned, or that you need to rush anything! So when you have time, and will, I'd be happy if you gave this some thought <3 |
Thanks, i think it looks good. I'm not sure if there is a simpler solution to the problem of which route selector to show and which ones to ignore, but i think this should work for all (?) situations now. |
Thanks @SMILEY4 I've been away for a while. And now I'm back ^^ |
I think its good to release. I'll merge it and release it soon 👍 |
Problem
There is a ktor library, that has a RouteSelector, that is not public to a application.
The Application gets the RouteSelector on the path, but is unable to specify it in the ignoredRouteSelectors, since it is not public.
In practice the
RouteCollector#getPath
func adds an extra/
for the custom RouteSelectorSolution
Drop extra slashes no matter the source.