Kotlin: unwrap an object using Jackson in Spring
I'm looking at trying to unwrap a Kotlin object to the top level of the JSON structure when it is unwrapped, but my app just seems to ignore the @Unwrapped annotation.
Here is my object:
data class MyResponse(
@JsonUnwrapped
val myObject: MyObject? = null,
val secondObject: String? = null
)
data class MyObject(
val fieldA: String
)
The controller:
@RestController
@RequestMapping(produces = [MediaType.APPLICATION_JSON_VALUE])
class MyController() {...