// This file was automatically generated from json.md by Knit tool. Do not edit. | |
package example.exampleJson18 | |
import kotlinx.serialization.* | |
import kotlinx.serialization.json.* | |
@Serializable | |
data class Project(val name: String, val language: String) | |
fun main() { | |
val element = buildJsonObject { | |
put("name", "kotlinx.serialization") | |
put("language", "Kotlin") | |
} | |
val data = Json.decodeFromJsonElement<Project>(element) | |
println(data) | |
} |