title: Java/Jackson Annotations: Mapping either an array or object?
body: <p>If I can get either of the following JSON bodies as responses:</p>
  
  <pre><code>{
     "error" : "some error",
     "code": 123
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>[
   {
      "name" : "name",
      "value" : "value"
   },
   {
      "name" : "name",
      "value" : "value"
   }
  ]
  </code></pre>
  
  <p>Is there a way to map either of these response to below Java POJO using annotations ?</p>
  
  <pre><code>public class Response {
      String error;
      int code;
      List&lt;NameValuePair&gt; nameValuePairs;
  }
  </code></pre>