티스토리 뷰

728x90
inline fun <reified T> ObjectMapper.readValue(json: String): T = readValue(json, object : TypeReference<T>(){})

https://stackoverflow.com/questions/34716697/how-do-i-deserialize-json-into-a-listsometype-with-kotlin-jackson

 

How do I deserialize JSON into a List<SomeType> with Kotlin + Jackson

What is the correct syntax to deserialize the following JSON: [ { "id" : "1", "name" : "Blues" }, { "id" : "0", "name" : "Rock" } ] I tried: //Works OK val dtos = mapper.readValue(json,

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Architecture] Lambda  (0) 2022.06.06
[gradle] implementation vs api  (0) 2022.06.06
[Spring] @ConfigurationProperties  (0) 2022.06.06
[Kotlin] Exception  (0) 2022.06.06
[Spring] Eureka Discovery  (0) 2022.06.06
댓글