path definitions on routes #131
Merged
+12
−17
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! |
f7a402c
into
twitter:master
1 check was pending
1 check was pending
No worries, thanks for merging. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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.