title: check if a jsonNode contains a specific key then EXTRACT its value once it exists
body: <p>I have this String an I covered it to jsonNode using the ObjectMapper. Then I tried to look for a pecific key in this jsonNode so I used the &quot;.has&quot; but it did not work !!
  Here is what I did :</p>
  <pre><code>{ 
      &quot;links&quot;: {
          &quot;data&quot;: {
              &quot;self&quot;: {
                  &quot;body&quot;: &quot;&quot;, 
                  &quot;content_type&quot;: &quot;&quot;,
                  &quot;href&quot;: &quot;/api/v2/nodes&quot;,
                  &quot;method&quot;: &quot;POST&quot;, 
                  &quot;name&quot;: &quot;&quot; 
              } 
          }
      },
      &quot;results&quot;: { 
          &quot;data&quot;: {
              &quot;properties&quot;: { 
                  &quot;container&quot;: true,
                  &quot;container_size&quot;: 0,
                  &quot;create_date&quot;: &quot;2020-06-22T16:19:07&quot;,
                  &quot;create_user_id&quot;: 1000,
                  &quot;description&quot;: &quot;&quot;
                  &quot;description_multilingual&quot;: { 
                      &quot;en&quot;: &quot;&quot;,
                      &quot;fr_FR&quot;: &quot;&quot; 
                  },
                  &quot;external_create_date&quot;: null,
                  &quot;external_identity&quot;: &quot;&quot;,
                  &quot;external_identity_type&quot;: &quot;&quot;,
                  &quot;external_modify_date&quot;: null,
                  &quot;external_source&quot;: &quot;&quot;,
                  &quot;favorite&quot;: false,
                  &quot;id&quot;: 276625,
                  &quot;mime_type&quot;: null,
                  &quot;modify_date&quot;: &quot;2020-06-22T16:19:07&quot;,
                  &quot;modify_user_id&quot;: 1000,
                  &quot;name&quot;: &quot;mar&quot;,
                  &quot;name_multilingual&quot;: {
                      &quot;en&quot;: &quot;mar&quot;,
                      &quot;fr_FR&quot;: &quot;&quot;
                  },
                  &quot;owner&quot;: &quot;Admin&quot;,
                  &quot;owner_group_id&quot;: 1001,
                  &quot;owner_user_id&quot;: 1000,
                  &quot;parent_id&quot;: 2000,
                  &quot;permissions_model&quot;: &quot;advanced&quot;,
                  &quot;reserved&quot;: false,
                  &quot;reserved_date&quot;: null,
                  &quot;reserved_shared_collaboration&quot;: false,
                  &quot;reserved_user_id&quot;: 0,
                  &quot;size&quot;: 0,
                  &quot;size_formatted&quot;: &quot;0 Eléments&quot;,
                  &quot;type&quot;: 0,
                  &quot;type_name&quot;: &quot;Dossier&quot;,
                  &quot;versions_control_advanced&quot;: false,
                  &quot;volume_id&quot;: -2000 
              } 
          } 
      }
  }
  </code></pre>
  <p>and I want to test whether it has the &quot;id&quot; key (it actually exists in line 31) so I used <code>.has()</code> as mentioned in <a href="https://stackoverflow.com/questions/17487205/how-to-check-if-a-json-key-exists">How to check if a json key exists?</a>:</p>
  <pre><code>ObjectMapper mapper = new ObjectMapper();    
  JsonNode rootNode= mapper.readTree(body);
           if(rootNode.has(&quot;id&quot;)){
              System.out.println(true);
           }
          else{
              System.out.println(false);
          }
  </code></pre>
  <p>but always it shows me &quot;false&quot; as output !!</p>