title: ObjectMapper readerForUpdating to replace array
body: <p>I have two different JSON files.</p>
  <p>File A:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;label&quot;: &quot;A&quot;,
      &quot;links&quot;: [
          {
              &quot;url&quot;: &quot;urla&quot;
          }
      ]
  }
  </code></pre>
  <p>File B:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;links&quot;: [
          {
              &quot;url&quot;: &quot;urlb&quot;
          }
      ]
  }
  </code></pre>
  <p>Now I want to update A with the contents of B to get the following result JSON:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;label&quot;: &quot;A&quot;,
      &quot;links&quot;: [
          {
              &quot;url&quot;: &quot;urlb&quot;
          }
      ]
  }
  </code></pre>
  <p>That is the <code>links</code> array should be fully replaced with the contents of B.
  But instead it merges the two Arrays:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;label&quot;: &quot;A&quot;,
      &quot;links&quot;: [
          {
              &quot;url&quot;: &quot;urla&quot;,
              &quot;url&quot;: &quot;urlb&quot;
          }
      ]
  }
  </code></pre>
  <p>This is not desired.
  The code for the merged file:</p>
  <pre class="lang-java prettyprint-override"><code>JsonNode A = ... // resolved from a service call
  JsonNode B = ... // resolved from a service call
  ObjectMapper mapper = new ObjectMapper();
  result = mapper.readerForUpdating(A).readValue(B);
  </code></pre>
  <p>I also tried to set <code>mapper.setDefaultMergeable(false);</code> but it didn't help.</p>
  <p>I use <code>com.fasterxml.jackson.core:jackson-core:jar:2.9.8</code></p>
  <p>Can someone help me?</p>