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
path definitions on routes #131
Conversation
Shame that this did not go in with 1.5.3 release. |
I know! It came in right after we had submitted to maven central. It'll go On Wed, Apr 16, 2014 at 10:14 AM, Bora Tunca notifications@github.comwrote:
Julio Capote |
Ok, thanks |
Is it possible to merge this, before I forgot about this pr and force push to branch again :) |
Feels like this won't be merged in, closing it. |
Hey, sorry about this, got lost in email. Please reopen and I'll merge. Thanks! |
No worries, thanks for merging. |
findRouteAndMatch
methodUse case is; on controller error handler (definition, usage) we want to log which endpoint is failed. One easy way to do that is to log the request path, but most of the paths we use have dynamic values (id, tag etc.). Therefore when we log the request path, we are having trouble when aggregating the log output for monitoring purposes. So instead of request path what we need is the route that is matched.
The closest I could get was getting the PathPattern from router as shown below;
Unfortunately PathPattern is not user friendly and doesn’t look good on graphs(eg
PathPattern(^/users/([^/?#]+)/xx/yy$,List(user))
). Therefore I added the the string path definition(eg) to theroutes
of the controller. So with the same code above we can get the human readable definition of the route that is matched.PS. this is a pain point for me, would be happy if you can either merge/release or suggest an alternative.
PS. also slightly refactored the method that does the matching.
PS. router does not have a spec.