title: How to set IgnoreCase on sort parameters from an http request in Spring Boot 1.4
body: <p>I have a Spring Boot backend running and accepting HTTP requests.</p>
  
  <p>Example: <a href="http://www.myserver.com/devices/" rel="nofollow noreferrer">http://www.myserver.com/devices/</a></p>
  
  <p>I'm using Pageable to handle the requests and automatic Pagination and Sorting, so I'm able to use requests like: <a href="http://www.myserver.com/devices?sort=name,desc" rel="nofollow noreferrer">http://www.myserver.com/devices?sort=name,desc</a></p>
  
  <p>There is an issue however, that the sort if case sensitive, and thus the desired sorting result (case insensitive sorting) is not obtained.</p>
  
  <p>I know Pageable Sort accepts two arguments for the sort attribute i.e. sort=name,desc but when inspecting the debugger I can see that the pageable's sort orders objects contain an ignoreCase attribute. </p>
  
  <p>Here is a snippet of code for the method that's being called via REST:</p>
  
  <pre><code>public class DeviceController {
  
      @Autowired
      DeviceViewRepository deviceViewRepository;
  
      @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
      public Page&lt;DeviceView&gt; getAllDevices(@PageableDefault(page = 0, size = 10, sort= "id") Pageable pageable) {
          try {
              return deviceViewRepository.findAll(pageable);
          } catch (Exception e){
              throw e;
          }
      }
  }
  </code></pre>
  
  <p>Is there any way to set that automatically/manually via the request url, PageableDefault, or any other method?</p>
  
  <p>Please keep in mind that the sort parameters are dynamic and the method in question is using the findAll() method of the Spring Data Repository.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I've found a similar issue here: <a href="https://stackoverflow.com/questions/30059312/spring-mvc-how-to-get-case-insensitive-ordering-from-pageable">Spring MVC: how to get case-insensitive ordering from Pageable</a></p>
  
  <p>This is essentially what I'm aiming for. I cannot comment there to ask how it was done or for tips, so if anyone knows how to implement that solution, I'd really appreciate a nudge in the right direction.</p>