I think you need to make sure that you register the jackson kotlin module which e.g. adds support for data classes.

Module that adds support for serialization/deserialization of Kotlin classes and data classes. Previously a default constructor must have existed on the Kotlin object for Jackson to deserialize into the object. With this module, single constructor classes can be used automatically, and those with secondary constructors or static factories are also supported.

With that you can create an ObjectMapper that already has this module registered using com.fasterxml.jackson.module.kotlin.ExtensionsKt#jacksonObjectMapper. (Note how you can also use one of the extensions it provides to avoid stating the payload class)

var mapper = jacksonObjectMapper()
val movie: Movie = mapper.readValue(payload)

As an alternative you can still create the object mapper and register the module using the usual API:

var mapper = ObjectMapper()
mapper.registerModule(KotlinModule())
Answer from Mathias Dpunkt on Stack Overflow
🌐
Baeldung
baeldung.com › home › libraries › jackson support for kotlin
Jackson Support for Kotlin | Baeldung on Kotlin
August 26, 2026 - While deserializing, if a field is missing from JSON String, the mapper will use the default value declared in our class for that field.
🌐
Stack Abuse
stackabuse.com › reading-and-writing-json-in-kotlin-with-jackson
Reading and Writing JSON in Kotlin with Jackson
February 27, 2023 - <dependency> <groupId>com.fast... JSON contents into a Kotlin object, let's define a User data class: data class User ( val id: Int, val username: String, val password: String, val fullName: String )...
🌐
BezKoder
bezkoder.com › home › kotlin – convert json to object and vice versa using jackson
Kotlin – Convert JSON to Object and vice versa using Jackson - BezKoder
December 13, 2020 - We can also use readValue() function to get a Kotlin List object from a JSON String array: import com.fasterxml.jackson.module.kotlin.* val jsonList = """[{"name": "bezkoder", "age": "26", "messages" : ["hello","becoming zKoder"]}, {"name":"bezkoder Master","age":30,"messages":["I am Kotlin Master","still learning Kotlin"]}]""" val mapper = jacksonObjectMapper() var personList: List
🌐
Kotlination
kotlination.com › kotlin-convert-object-to-from-json-jackson-2
Convert Object to/from JSON with Jackson 2.x - Kotlination
basic bufferedreader bufferedwriter ... jackson java equivalent json kotlin helloworld kotlin programming lazy initialization list maven object expressions partition postgresql property regex rest api singleton sorting spring boot spring boot kotlin spring jpa spring kotlin string ...
🌐
Mario Fernandez
hceris.com › painless json with kotlin and jackson
Painless JSON with Kotlin and jackson | Mario Fernandez
June 16, 2019 - I’ve seen many bugs where the ... it as follows: ... data class UserId(private val value: String) { companion object { @JvmStatic @JsonCreator fun create(value: String) = UserId(value.toLowerCase()) } @JsonValue override fun toString() = value }...
🌐
Techie Delight
techiedelight.com › home › java › parse a json string in kotlin
Parse a JSON String in Kotlin | Techie Delight
July 7, 2026 - Output: JSON string is: {"name":"Peter ... prefer the Jackson library over Gson, you can use its ObjectMapper#readValue() function to convert the JSON string into the specified object....
🌐
Delft Stack
delftstack.com › home › howto › kotlin › parse json in kotlin
How to Parse JSON String to Object in Kotlin | Delft Stack
February 2, 2024 - In this code, we have created a string representing our JSON object and a class that will be used to map the string to a Kotlin object. The properties created in the class must be the same as the keys in the JSON string.
Find elsewhere
🌐
Stack Overflow
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 - Stack Overflow
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...
🌐
Medium
medium.com › @js_9757 › polymorphic-json-parsing-with-kotlin-and-jackson-b7a8549fef9c
Polymorphic JSON Parsing with Kotlin and Jackson | by Jens@Fivesec | Medium
August 27, 2024 - ... { "type": "car", "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "topSpeed": 250.0, "manufacturer": "BMW" } Our goal is to parse this payload directly into the appropriate target class using a parser operation.
🌐
Educative
educative.io › answers › parsing-api-data-in-kotlin-using-jackson
Parsing API data in Kotlin using Jackson
Jackson is a library that helps us serialize and deserialize​ data into a format that best suits our needs. Jackson is used extensively in Java applications and now has a fantastic Kotlin-compatible module. A sample of the demo response that we’ll be working with is detailed below: ... As shown, the results are passed back to us in a JSON format.
Top answer
1 of 4
67

With Jackson Kotlin Module current versions, if you import the full module package or the specific extension function you'll have all extension methods available. Such as:

import com.fasterxml.jackson.module.kotlin.*  
val JSON = jacksonObjectMapper()  // keep around and re-use
val myList: List<String> = JSON.readValue("""["a","b","c"]""")

Therefore the Jackson Module for Kotlin will infer the the correct type and you do not need a TypeReference instance.

so your case (slightly renamed and fixed the data class, and JSON):

import com.fasterxml.jackson.module.kotlin.readValue

data class MyData(val a: String, val b: Int)
val JSON = jacksonObjectMapper()  

val jsonStr = """[{"a": "value1", "b": 1}, {"a": "value2", "b": 2}]"""
val myList: List<MyData> = JSON.readValue(jsonStr)

You can also use the form:

val myList = JSON.readValue<List<MyData>>(jsonStr)

Without the import you will have an error because the extension function is not found.

2 of 4
25

TL;DR

With Jackson 2.6.3-2 do as @jason-minard advises and simply use:

import com.fasterxml.jackson.module.kotlin.readValue

val listOfD: List<D> = jacksonMapper.readValue(jsonStr)

Details

There's nothing special about Kotlin wrt to deserializing collections, although you'll need the kotlin jackson module to deserialize data classes without annotations.

Namely, it will require full reified type information in your case in order to keep track of the generic parameter of the list (D) ; otherwise (e.g. if you use readValue(jsonStr, List::class.java)) Jackson will only see it as an erased type (i.e. List) (as Kotlin makes explicit) and deserialize it to a List<Map<String, String>>, not knowing it has to construct Ds. This is worked around by using an anonymous subclass of TypeReference in Java so that Jackson can access the full reified type to deserialize to at run time.

Translating Jackson Java code literally to Kotlin, the following thus achieves what you want (and as commented by @eski, notice that the JSON in your example is invalid):

val jacksonMapper = ObjectMapper().registerModule(KotlinModule())

val jsonStr = """[{"a": "value1", "b": 1}, {"a": "value2", "b":2}]"""
val listOfD: List<D> = jacksonMapper.readValue(jsonStr, object : TypeReference<List<D>>(){})

assertEquals(listOf(D("value1", 1), D("value2", 2)), listOfD)

This is a bit verbose and ugly though, so you could hide it in a Kotlin (extension) function (especially if you plan on using it several times):

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

which would allow you to then just call:

val listOfD: List<D> = jacksonMapper.readValue(jsonStr)

And this is just what's included in the 2.6.3-2 jackson Kotlin module.

🌐
Medium
medium.com › javarevisited › type-driven-deserialization-in-kotlin-using-jackson-a0b2b5a729a1
Type driven Deserialization in Kotlin using Jackson | by Janani Subbiah | Javarevisited | Medium
October 2, 2024 - Next, we add all the magic annotations (well just two)that will let your code analyze the raw json request body and know if the incoming request needs to be deserialized into a Student class or an Employee class. data class Person( val name: String, val type: PersonType, @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "type", visible = true ) @JsonSubTypes(value = [ JsonSubTypes.Type(value = Student::class, name = "student"), JsonSubTypes.Type(value = Employee::class, name = "employee") ]) val info: PersonInfo ) enum class PersonType { @JsonProperty("student") STUDENT, @JsonProperty("employee") EMPLOYEE } interface PersonInfo data class Student( val grade: Int ): PersonInfo data class Employee( val salary: Int ): PersonInfo
🌐
Baeldung
baeldung.com › home › kotlin › kotlin strings › how to extract individual values from a json string
How to Extract Individual Values From a JSON String | Baeldung on Kotlin
January 8, 2024 - In the example above, we first create a Gson object and then use its fromJson() method to deserialize the JSON string to a JsonObject. Subsequently, we use the get() method of the JsonObject to get the value of a particular property.
🌐
Baeldung
baeldung.com › home › libraries › how to parse json without data class in kotlin
How to Parse JSON Without Data Class in Kotlin | Baeldung on Kotlin
March 19, 2024 - The latest version of the Jackson Kotlin module can be found on Maven Central · First, we create an ObjectMapper instance endowed with Kotlin module support: ... Let jsonString be the String variable holding the content we want to deserialize.
🌐
CodeSignal
codesignal.com › learn › courses › handling-json-files-with-kotlin-2 › lessons › introduction-to-json-handling-with-kotlin
Introduction to JSON Handling with Kotlin
The ObjectMapper is a core class in the Jackson library, designed to convert JSON content to and from Kotlin objects. It provides functionalities to parse JSON into tree structures and serialize objects into JSON strings.
🌐
GitHub
github.com › FasterXML › jackson-module-kotlin
GitHub - FasterXML/jackson-module-kotlin: Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes. · GitHub
ObjectMapper.readValue accepts the same sources as the original, namely JsonParser, File, String, Reader, InputStream and ByteArray. Note that these are not merely shorthands: since 2.19.0, most of them check the deserialized value to preserve Kotlin null safety.
🌐
CodeSignal
codesignal.com › learn › courses › handling-json-files-with-kotlin-2 › lessons › working-with-json-in-kotlin-using-jackson
Working with JSON in Kotlin Using Jackson
In previous lessons, you learned how to parse JSON files in Kotlin and explore JSON's hierarchical structure. Now, we'll focus on constructing JSON objects and writing them to files. In this lesson, you'll discover how to create JSON objects using Kotlin's data classes and serialize them using the Jackson library's ObjectMapper class.