title: Generate Data class on dynamic value inside a JSON payload
body: <p>I have a payload which look like this :</p>
  <pre><code>{
      &quot;data&quot;: {
          &quot;12345&quot;: {
              &quot;is_indexable&quot;: true,
              &quot;description&quot;: &quot;Lorem description&quot;,
              &quot;items&quot;: {
                  &quot;id&quot;: 2644,
                  &quot;name&quot;: &quot;Naming here&quot;
              }
          },
          &quot;678910&quot;: {
              &quot;is_indexable&quot;: false,
              &quot;description&quot;: &quot;Lorem description 2&quot;,
              &quot;items&quot;: {
                  &quot;id&quot;: 29844,
                  &quot;name&quot;: &quot;Naming here again&quot;
              }
          }
      }
  }
  </code></pre>
  <p>I wanted to generate a specific data class for that payload using tools like <a href="https://transform.tools/json-to-kotlin" rel="nofollow noreferrer">https://transform.tools/json-to-kotlin</a> but it's impossible since the array inside the &quot;data&quot; object is an ID (so a dynamic data)</p>
  <pre><code>data class Root(
      val data_field: Data
  )
  
  data class Data(
      val payload: List&lt;Payload&gt;, // Something to represent the dynamic ids
  )
  
  data class Payload(
      val isIndexable: Boolean,
      val description: String,
      val items: Items
  )
  
  data class Items(
      val id: Long,
      val name: String
  )
  </code></pre>
  <p>I don't know if I'm clear, did you have an idea to make this in a <em>clean way</em> ?</p>
  <p>Thank you all !</p>