1*57b5a4a6SAndroid Build Coastguard Worker // This file was automatically generated from json.md by Knit tool. Do not edit. 2*57b5a4a6SAndroid Build Coastguard Worker package example.exampleJson10 3*57b5a4a6SAndroid Build Coastguard Worker 4*57b5a4a6SAndroid Build Coastguard Worker import kotlinx.serialization.* 5*57b5a4a6SAndroid Build Coastguard Worker import kotlinx.serialization.json.* 6*57b5a4a6SAndroid Build Coastguard Worker <lambda>null7*57b5a4a6SAndroid Build Coastguard Workerval format = Json { classDiscriminator = "#class" } 8*57b5a4a6SAndroid Build Coastguard Worker 9*57b5a4a6SAndroid Build Coastguard Worker @Serializable 10*57b5a4a6SAndroid Build Coastguard Worker sealed class Project { 11*57b5a4a6SAndroid Build Coastguard Worker abstract val name: String 12*57b5a4a6SAndroid Build Coastguard Worker } 13*57b5a4a6SAndroid Build Coastguard Worker 14*57b5a4a6SAndroid Build Coastguard Worker @Serializable 15*57b5a4a6SAndroid Build Coastguard Worker @SerialName("owned") 16*57b5a4a6SAndroid Build Coastguard Worker class OwnedProject(override val name: String, val owner: String) : Project() 17*57b5a4a6SAndroid Build Coastguard Worker mainnull18*57b5a4a6SAndroid Build Coastguard Workerfun main() { 19*57b5a4a6SAndroid Build Coastguard Worker val data: Project = OwnedProject("kotlinx.coroutines", "kotlin") 20*57b5a4a6SAndroid Build Coastguard Worker println(format.encodeToString(data)) 21*57b5a4a6SAndroid Build Coastguard Worker } 22