I have the following class that takes json such as...
# serialization
z
I have the following class that takes json such as this and makes it easier to use. Can I further improve it and get rid of having to go through`model` and be able to access the type directly? maybe using typealias serializer annotation
Copy code
{
  "elementRenderer": {
    "newElement": {
      "type": {
        "componentType": {
          "model": { ... }
        }
      }
    }
  }
}
Copy code
@Serializable
internal open class ElementRenderer<T>(private val newElement: NewElement<T>) {
    val model = newElement.type.componentType.model

    @Serializable
    data class NewElement<T>(val type: Type<T>)

    @Serializable
    data class Type<T>(val componentType: ComponentType<T>)

    @Serializable
    data class ComponentType<T>(val model: T)
}