How to obtain REST URI Template #27798
Unanswered
jimbogithub
asked this question in
Q&A
Replies: 1 comment
-
OK, it can be done, but is pretty dirty:
Can we enhance Quarkus to expose this in a supported way? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to obtain the REST URI Template, e.g. given:
@Path("test/{p1}/{p2}/extra/{p2}")
I literally want the"test/{p1}/{p2}/extra/{p2}"
including any parent relative path component. I do not want the path with parameters replaced such asUriInfo::getPath()
provides.Is there a way to do it?
It can't be reverse engineered reliably from
UriInfo::getPathSegments
andUriInfo ::getPathParameters
as a fixed path segment may have the same name as a param value.It's tricky to derive it from the endpoint annotations as you would have to check class and method and root etc.
It looks like it might be available at
VertxResteasyReactiveRequestContext::getTarget().getClassPath().template
but there's no way to obtain that.FWIW Spring makes this available at
HttpServletRequest::getAttribute(org.springframework.web.servlet.HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE)
Beta Was this translation helpful? Give feedback.
All reactions