Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3379 Implement Jakarta REST 4.0
  3. RESTEASY-3483

Implement the UriInfo#getMatchedResourceTemplate method

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.Alpha1
    • None
    • Core
    • 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}".

            jperkins-rhn James Perkins
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: