title: Mapping nested JSON values in a Java class
body: <p>I can't figure out how to handle nested JSON values in my Java classes. To make it simple as possible, I created four Java classes with every 'nested level'. However, I'm trying to have all these values in one Java class. How can I do this?</p>
  <p>Json:</p>
  <pre><code>{
     &quot;_embedded&quot;:{
        &quot;events&quot;:[
           {
              &quot;name&quot;:&quot;KISS | End Of The Road World Tour&quot;,
              &quot;dates&quot;:{
                 &quot;start&quot;:{
                    &quot;dateTime&quot;:&quot;2021-06-12T19:00:00Z&quot;
                 },
                 &quot;classifications&quot;:[
                    {
                       &quot;name&quot;:&quot;Rock&quot;
                    }
                 ],
                 &quot;_embedded&quot;:{
                    &quot;venues&quot;:[
                       {
                          &quot;name&quot;:&quot;Atlas Arena&quot;
                       }
                    ]
                 }
              }
           }
        ]
     }
  }
  </code></pre>
  <p>Java classes:</p>
  <pre><code>@Data
  public class EventList {
  
      @JsonProperty(&quot;_embedded&quot;)
      private Events events;
  }
  
  
  @Data
  public class Events {
  
      @JsonProperty(&quot;events&quot;)
      public List&lt;EventDetails&gt; eventsList;
  }
  
  @Data
  public class EventDetails {
  
      private String name;
      @JsonProperty(&quot;dates.start.dateTime&quot;)
      private String startDate;
      @JsonProperty(&quot;classifications.genre.name&quot;)
      private String musicType;
      @JsonProperty(&quot;_embedded.venues&quot;)
      private List&lt;Venues&gt; eventPlaceName;
  }
  
  @Data
  public class Venues {
  
      private String name;
  }
  </code></pre>