Can somebody explain me, why ``` fun <T> ...
# announcements
s
Can somebody explain me, why
Copy code
fun <T> fromJson2(jsonString: String ) : List<T> {
        val JSON =  ObjectMapper().registerModule(KotlinModule())
        val myList = JSON.readValue<List<T>>(jsonString)
        return  myList
    }
returns
java.util.LinkedHashMap
instead of
Employee
, when called like
Copy code
val employee2 : List<Employee> = fromJson2<Employee>(jsonString = jsonString)
I just don't get it... If I change
<List<T>>
to
<List<Employee>>
it works, but then it's not general code that I can use to serialize json to object..