title: How to get nested array values in main class - JSON to POJO
body: <p>I have a JSON like this:</p>
  <pre><code>{
     &quot;types&quot;:[
        {
           &quot;slot&quot;:1,
           &quot;type&quot;:{
              &quot;name&quot;:&quot;grass&quot;,
              &quot;url&quot;:&quot;https://pokeapi.co/api/v2/type/12/&quot;
           }
        },
        {
           &quot;slot&quot;:2,
           &quot;type&quot;:{
              &quot;name&quot;:&quot;poison&quot;,
              &quot;url&quot;:&quot;https://pokeapi.co/api/v2/type/4/&quot;
           }
        }
     ]
  }
  </code></pre>
  <p>I need only names of types, so I'd like to have something like this:</p>
  <pre><code>public class MainClass {
  
      private List&lt;String&gt; types;
  }
  </code></pre>
  <p>I want to avoid creating of nested classes. How can I get this result?</p>