title: Java, Jackson: Deep Copy Interface
body: <p>I am using Jackson to deep-copy an object, like so:</p>
  
  <pre><code>   Map&lt;String,Object&gt; props = mapper.convertValue(prototype, Map.class); 
     Command command = mapper.convertValue(props, Command.class);
  </code></pre>
  
  <p>However, since <code>Command</code> is an interface without <code>@JsonTypeInfo</code> attached, this copy fails with error: <code>Can not construct instance of Command.. abstract type</code>.</p>
  
  <p>I don't want to annotate the interface.  I want to provide type information at the conversation level.  </p>
  
  <p>How do I do that? </p>
  
  <hr>
  
  <p>I thought this would work:</p>
  
  <pre><code>mapper.enableDefaultTyping();
  </code></pre>
  
  <p>Whereby type info would automatically be added for both de/serialization, but I get:</p>
  
  <pre><code>Unexpected token (START_OBJECT), expected START_ARRAY: need JSON Array to contain As.WRAPPER_ARRAY type information for class java.util.Map
  </code></pre>
  
  <p>So the Map is not getting the type info it needs.</p>