Am I doing something wrong? ``` jacksonObjectMappe...
# getting-started
p
Am I doing something wrong?
Copy code
jacksonObjectMapper().convertValue("{\"name\":\"Jack\",\"age\":7}", Dog.class)
Copy code
data class Dog(
    val name: String,
    val age: Int
)
doing:
Copy code
objectMapper.convertValue<Dog>("{\"name\":\"Jack\",\"age\":7}")
throws:
Copy code
Cannot construct instance of `com.example.Dog` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('{"name":"Jack","age":7}')
 at [Source: UNKNOWN; line: -1, column: -1]
s
you can do that yo make your json more readable
val myJson = """{"name":"Jack","age":7}"""