Exactly, you serilize to Json, not to js code that...
# serialization
g
Exactly, you serilize to Json, not to js code that creates some object on JS. With Kotlin you can do exactly the same. Looks that pretty print from Python also just prints collections representation, not a class or some other complicated structure. I don't know existing implementation, but for some not very advanced cases is not hard to write such code, that prints collection data, or even data class as valid Kotlin code. But I still not sure that it's really useful. For your example with Person and NewPerson make sense just to write unit test manually, or even some reflection based automatic verifier, instead of generation of Kotlin code for check