title: JSON to Java object - Unrecognized field, not marked as ignorable
body: <p>I'm trying to transform the following JSON into a java Object.</p>
  
  <pre><code>{
    "Data":[
      {
        "AccountId":"2009852923",
        "Currency":"EUR",
        "Nickname":"SA 01",
        "Account":{
          "SchemeName":"BBAN",
          "Name":"SA 01",
          "Identification":"2009852923"
        },
        "Servicer":{
          "SchemeName":"BICFI",
          "Identification":"FNBSZAJJ"
        }
      },
      {
        "AccountId":"1028232942",
        "Currency":"EUR",
        "Nickname":"FNBCREDIT",
        "Account":{
          "SchemeName":"BBAN",
          "Name":"FNBCREDIT",
          "Identification":"1028232942"
        },
        "Servicer":{
          "SchemeName":"BICFI",
          "Identification":"FNBSZAJJ"
        }
      }
    ],
    "Links":{
      "self":"http://localhost:3000/api/open-banking/accounts/1009427721/transactions"
    },
    "Meta":{
      "total-pages":1
    }
  }
  </code></pre>
  
  <p>Using the following DTO (for brevity, the referenced classes haven't been posted).</p>
  
  <pre class="lang-java prettyprint-override"><code>public class TransactionDTO {
      private Data[] data;
      private Links links;
      private Meta meta;
      public Data[] getData () {  return data; }
      public void setData (Data[] data) { this.data = data; }
      public Links getLinks () { return links; }
      public void setLinks (Links links) { this.links = links; }
      public Meta getMeta () { return meta; }
      public void setMeta (Meta meta) { this.meta = meta; }
  }
  </code></pre>
  
  <p>The code to transform the DTO to a Java object being:</p>
  
  <pre class="lang-java prettyprint-override"><code>private TransactionDTO marshall(String accountTransactionsJSON) {
      ObjectMapper objectMapper = new ObjectMapper();
      TransactionDTO transactionDTO = null;
      try {
          transactionDTO = objectMapper.readValue(accountTransactionsJSON, TransactionDTO.class);
      } catch (IOException e) {
          e.printStackTrace();
      }
      return transactionDTO;
  }
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre class="lang-java prettyprint-override"><code>com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "Data" (class xxx.dto.TransactionDTO), not marked as ignorable (3 known properties: "links", "data", "meta"])
   at [Source: java.io.StringReader@48f43b70; line: 2, column: 11] (through reference chain: xxx.dto.TransactionDTO["Data"])
  </code></pre>
  
  <p>I tried different approach to solve this issue such as:</p>
  
  <pre class="lang-java prettyprint-override"><code>objectMapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
  objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
  objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  </code></pre>
  
  <p>As well as:</p>
  
  <pre><code>@JsonRootName(value = "data")
  </code></pre>
  
  <p>But I either get the same problem, or no problems, but the <code>TransactionDTO</code> containing <code>null</code> values only.</p>
  
  <p>I guess the problem is the <code>Data</code> field, but I don't know how to fix this problem (the solutions <a href="https://www.baeldung.com/jackson-annotations" rel="noreferrer">here</a> don't work for me neither). </p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>Any idea how to fix this problem ?</li>
  <li>Should the accessors case reflect the case in the JSON ?</li>
  </ol>