-
Sub-task
-
Resolution: Done
-
Major
-
None
-
None
https://github.com/jakartaee/rest/pull/1236 introduced a UriInfo.getMatchedResourceTemplate() method. This needs to be implemented for Jakarta REST 4.0.
The return type is a String and needs to include an @ApplicationPath() value if defined as well. Empty slashes should be considered empty paths.
Example:
@ApplicationPath("/api") pubic class RestActivator extends Application{} @Path("/order") public class Orders { @GET @Path("{id}") public Order order(@PathParam("id") final long orderId) { return orders.order(orderId); } }
The above should return "/api/order/{id}".
@ApplicationPath("/") pubic class RestActivator extends Application{} @Path("/order") public class Orders { @GET @Path("status/{id}") public Order order(@PathParam("id") final long orderId) { return orders.order(orderId); } }
The above should return "/order/status/{id}".