title: Spring MVC @RequestParam - empty List vs null
body: <p>By default Spring MVC assumes <code>@RequestParam</code> to be required. Consider this method (in Kotlin):</p>
  
  <pre><code>fun myMethod(@RequestParam list: List&lt;String&gt;) { ... }
  </code></pre>
  
  <p>When passing empty list from javaScript, we would call something like:</p>
  
  <pre><code>$.post("myMethod", {list: []}, ...)
  </code></pre>
  
  <p>In this case however, as the list is empty, there is no way to serialize empty list, so the parameter essentially disappears and so the condition on required parameter is not satisfied. One is forced to use the <code>required: false</code> on the <code>@RequestParam</code> annotation. That is not nice, because we will never receive the empty list, but null.</p>
  
  <p>Is there a way to force Spring MVC always assume empty lists in such case instead of being <code>null</code>?</p>