Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-347

random invocation of QueryParam annotated rest methods

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 1.2.1.GA
    • None
    • None

    Description

      I have two rest methods, something like this:

      @GET
      @Path("/something")
      @Produces(MediaType.APPLICATION_XML)
      public abstract List<Something> getSomethingByA(@QueryParam("a") String a);

      @GET
      @Path("/something")
      @Produces(MediaType.APPLICATION_XML)
      public abstract List<Something> getSomethingByB(@QueryParam("b") String b);

      It seems like resteasy is invoking the methods randomly, both in our jUnit and real tests. e.g. A call to /something?a=xyz may end up in getSomethingByB and not getSomethingByA as expected.

      Our workaround is to expose only whone method:

      @GET
      @Path("/something")
      @Produces(MediaType.APPLICATION_XML)
      public abstract Option<Agreement> getSomething(@QueryParam("a") String a, @QueryParam("b") String b);

      But then one has to do null checks in the code.

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            sanjoa Joakim Sandstroem (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: