Roman Elizarov | 5459c10 | 2020-08-11 12:27:36 +0300 | [diff] [blame] | 1 | // This file was automatically generated from basic-serialization.md by Knit tool. Do not edit. |
| 2 | package example.exampleClasses08 |
| 3 | |
| 4 | import kotlinx.serialization.* |
| 5 | import kotlinx.serialization.json.* |
| 6 | |
Leonid Startsev | 3ac9b89 | 2022-01-26 12:45:00 +0300 | [diff] [blame] | 7 | @Serializable |
Roman Elizarov | 5459c10 | 2020-08-11 12:27:36 +0300 | [diff] [blame] | 8 | data class Project(val name: String, @Transient val language: String = "Kotlin") |
| 9 | |
| 10 | fun main() { |
| 11 | val data = Json.decodeFromString<Project>(""" |
| 12 | {"name":"kotlinx.serialization","language":"Kotlin"} |
| 13 | """) |
| 14 | println(data) |
| 15 | } |