Usually people tend to use Spring Boot builtin support for https://github.com/Kotlin/kotlinx.serialization, Jackson or Gson. You can likely get related beans instead of doing what has been shared. For WebFlux or WebMvc JSON serialization/deserialization happen automatically.