title: Overloading RestController methods that include different pathvariable types
body: <p>I have the following problem: </p>
  
  <p>I have a Rest controller that I want to configure in the following URLs:</p>
  
  <p><strong>/api/districts/1,2,3</strong> - (list districts by array of ids)</p>
  
  <p><strong>/api/districts/1</strong> - (list district by a single id)</p>
  
  <p>These are the following mapping methods: </p>
  
  <pre><code>@RequestMapping(value = "/{id}", method = RequestMethod.GET)
  public District getById(@PathVariable int id) {
      // check input
  
      return districtService.getById(id);
  }
  
  @RequestMapping(value = "/{districtIDs}", method = RequestMethod.GET)
  public List&lt;District&gt; listByArray(@PathVariable Integer[] districtIDs) {
      ArrayList&lt;District&gt; result = new ArrayList&lt;&gt;();
  
      for (Integer id : districtIDs) {
          result.add(districtService.getById(id));
      }
  
      return result;
  }
  </code></pre>
  
  <p>This is the error I'm getting when I make a request to <strong>/api/districts/1,2,3</strong></p>
  
  <p><code>There was an unexpected error (type=Internal Server Error, status=500).
  Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/api/districts/1,2,3': {public java.util.List com.groto.server.web.DistrictsController.listByArray(java.lang.Integer[]), public com.groto.server.models.hibernate.District com.groto.server.web.DistrictsController.getById(int)}</code></p>
  
  <p>this is the error I'm getting when I make a request to <strong>/api/districts/1</strong></p>
  
  <p><code>There was an unexpected error (type=Internal Server Error, status=500).
  Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/api/districts/1': {public java.util.List com.groto.server.web.DistrictsController.listByArray(java.lang.Integer[]), public com.groto.server.models.hibernate.District com.groto.server.web.DistrictsController.getById(int)}</code></p>