Input
{
"Data": [
{
"name": "MEDICAL CONDITION",
"show": true,
"id": 1
},
{
"name": "LAB TEST REPORT",
"show": true,
"id": 9,
"type": [
{
"id": 21,
"name": "CULTURE REPORT",
"show": true
}
]
}
]
}
Expected Output
data class MyModel(
val data: List<Data>
) {
data class Data(
val id: Int, // 1
val name: String, // MEDICAL CONDITION
val show: Boolean, // true
val type: List<Type>
) {
data class Type(
val id: Int, // 21
val name: String, // CULTURE REPORT
val show: Boolean // true
)
}
}
Actual Output
data class MyModel(
val Data: List<Data>
) {
data class Data(
val id: Int, // 1
val name: String, // MEDICAL CONDITION
val show: Boolean, // true
val type: List<Type>
) {
data class Type(
val id: Int, // 21
val name: String, // CULTURE REPORT
val show: Boolean // true
)
}
}
What's wrong?

Source : https://plugins.jetbrains.com/plugin/9960-json-to-kotlin-class-jsontokotlinclass-/reviews#review=26525
Input
{ "Data": [ { "name": "MEDICAL CONDITION", "show": true, "id": 1 }, { "name": "LAB TEST REPORT", "show": true, "id": 9, "type": [ { "id": 21, "name": "CULTURE REPORT", "show": true } ] } ] }Expected Output
Actual Output
What's wrong?

Source : https://plugins.jetbrains.com/plugin/9960-json-to-kotlin-class-jsontokotlinclass-/reviews#review=26525