I've started working with RestEasy and I've come across a problem that I can't seem to find an answer to. If I have 2 methods that both resolve to the same path (in this case /path1/path2/path3), but they both have a different number of query parameters, will RestEasy be able to 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've done some testing and yesterday it seemed that everything was working perfectly and that it could choose the right path, but now today I'm starting to see it take the wrong path each time.
Is this something that should be handled, or should I just suck it up and put it in 1 method and do the check myself?