jersey
  1. jersey
  2. JERSEY-1675

Inconsistent generation of WADL for parameterized sub resources.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.16
    • Fix Version/s: 1.18
    • Component/s: core
    • Labels:
      None

      Description

      Consider this simple resource class:

      package project1;

      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.PathParam;
      import javax.ws.rs.WebApplicationException;
      import javax.ws.rs.core.Response;

      @Path("/")
      public class RootResource {

      @Path("sub/

      {id}")
      public ChildResource getChild(@PathParam("id") int id) {
      if (id < 10) { return new ChildResource(id); }
      else { throw new WebApplicationException(Response.Status.NOT_FOUND); }
      }


      @Path("{id}

      ")
      @GET
      public String getChildString(@PathParam("id") int id) {
      if (id < 10)

      { return Integer.toString(id); }

      else

      { throw new WebApplicationException(Response.Status.NOT_FOUND); }

      }

      }

      package project1;

      import javax.ws.rs.*;

      public class ChildResource {

      int _id;

      ChildResource(int id)

      { _id = id; }

      @GET
      @Produces("text/plain")
      public String getChild()

      { return Integer.toString(_id); }

      }

      The inconsistency here is that

      OPTIONS http://127.0.0.1:7101/Application1-Project1-context-root/resources/20

      Will return a correctly defined WADL; but that the version that tried to access the sub resource returns a 404, page not found error.

      OPTIONS http://127.0.0.1:7101/Application1-Project1-context-root/resources/sub/20

      I think I would like the second URL to return a WADL as it make tooling so much easier to deal with.

        Activity

        Hide
        Marek Potociar added a comment -

        Not a critical issue. Will not fix in the sustained Jersey 1.x code.

        Show
        Marek Potociar added a comment - Not a critical issue. Will not fix in the sustained Jersey 1.x code.

          People

          • Assignee:
            Unassigned
            Reporter:
            gdavison
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: