Converting JSON String to Data Class instance in Spring project -
in controller function json via @requestbody
data class
. want store data class
string , later turn data class
.
how can achieve this?
i'm not sure why want can request body coming through controller raw json changing accept header application/json plain/text , changing input parameter data class string.
you can turn data class object manually later on calling jackson objectmapper class directly.
val mapper = objectmapper() val mydataobject : mydataobject = mapper.readvalue(rawjsonstring, mydataobject::class.java)
Comments
Post a Comment