title: Two GET methods with different number of query parameters : REST
body: <p>I have an Rest endpoint class as below :  </p>
  
  <pre><code>@Path("/sports")
  public interface SportsEndpoint {
  
      @GET
      List&lt;Player&gt; getPlayersOfSports(@QueryParam("sportId") String sportId, @QueryParam("sportName") String sportName);
  
  
      @GET
      List&lt;Player&gt; getPlayersOfSports(@QueryParam("sportId") String sportId, @QueryParam("sportName") String sportName, @QueryParam("country") String country);
  
  }
  </code></pre>
  
  <p>As you can see, I have two <code>GET</code> methods which has almost the same signature except the second method takes an additional <code>QueryParam</code>.  </p>
  
  <p>I try to access these endpoints using the urls: </p>
  
  <p><code>http://localhost:8080/rest/api/sports?sportId=100&amp;sportName=badminton</code>
  <code>http://localhost:8080/rest/api/sports?sportId=100&amp;sportName=badminton&amp;country=japan</code></p>
  
  <p>Both these urls are resolving to use the first method signature. Ideally, I was expecting that for the first url, the first method signature would be called and for the second url the second method(the one with 3 query parameters) would have been called.<br>
  But looks like in both cases the first method is getting called.  </p>
  
  <p>I know that Rest resources are uniquely identified by the path and not the query parameters. But is it also true that even though the number of query parameters are different, the rest endpoint will not be uniquely identified ?<br>
  Can someone point me to some specifications/articles/documentation where I can understand polymorphism when it comes to designing rest api endpoints ?</p>
  
  <p>FYI: I am using RestEasy.</p>