I started working with RestEasy, and I had a problem that I cannot find an answer to. If I have two methods that allow the same path (in this case / path 1 / path2 / path3), but both have a different number of query parameters, can RestEasy determine which method to use?
@GET @NoCache @Produces({ MediaType.APPLICATION_JSON }) @Path("/path1/path2/{path3}") public String getResults1( @PathParam("path3") String path3, @QueryParam("query1") @DefaultValue("") String query1, @QueryParam("query2") String query2, @QueryParam("query3") @DefaultValue("25") int query3) { ... } @GET @NoCache @Produces({ MediaType.APPLICATION_JSON }) @Path("/path1/path2/{path3}") public String getResults2( @PathParam("path3") String path3, @QueryParam("query1") @DefaultValue("") String query1, @QueryParam("query2") @DefaultValue("5") Integer query2) { ... }
I did some testing, and yesterday it seemed that everything was working fine and that he could choose the right path, but now I am starting to see that he takes the wrong path every time.
Is this something that needs to be processed, or should I just suck it and put it in one method and do a self check?
source share