title: Spring @RequestBody containing a list of different types (but same interface)
body: <p>Let's say that I have a domain class :</p>
  
  <pre><code>    public class Zoo{
          private List&lt;Animal&gt; animals;
          ....
  </code></pre>
  
  <p>where an Animal is an interface with different implementations (Cat,Dog). Let's say that I want to be able to save a Zoo object :</p>
  
  <pre><code>    @RequestMapping(value = "/zoo", method = RequestMethod.POST)
      public @ResponseBody void save(@RequestBody Zoo zoo) {
      ....
  </code></pre>
  
  <p>and I want to send a json - something like :</p>
  
  <pre><code>    {
          animals:[
              {type:'Cat', whiskers-length:'3'},
              {type:'Dog', name:'Fancy'}
          ]
      }
  </code></pre>
  
  <p>How can I tell spring MVC to map animal to Cat type when type=='Cat' and to map it to a Dog class when type=='Dog'?</p>