blob: 50de55fdc7568b64d7071e543dc7b91678a72c63 [file] [log] [blame]
// This file was automatically generated from json.md by Knit tool. Do not edit.
package example.exampleJson14
import kotlinx.serialization.*
import kotlinx.serialization.json.*
@Serializable
data class Project(val projectName: String, val projectOwner: String)
val format = Json { namingStrategy = JsonNamingStrategy.SnakeCase }
fun main() {
val project = format.decodeFromString<Project>("""{"project_name":"kotlinx.coroutines", "project_owner":"Kotlin"}""")
println(format.encodeToString(project.copy(projectName = "kotlinx.serialization")))
}