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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -