String
You can
use ConfigValue#render
to serialize Config. Config4k helps getting Config of the class you want to serialize.
Any.toConfig converts the receiver object to Config.
data class Person(
val name: String,
val age: Int,
)
val person = Person("foo", 20).toConfig("person")
println(person.root().render())
Output: