summaryrefslogtreecommitdiff
path: root/guide/example/example-serializer-22.kt
diff options
context:
space:
mode:
Diffstat (limited to 'guide/example/example-serializer-22.kt')
-rw-r--r--guide/example/example-serializer-22.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/guide/example/example-serializer-22.kt b/guide/example/example-serializer-22.kt
new file mode 100644
index 00000000..4eba74b0
--- /dev/null
+++ b/guide/example/example-serializer-22.kt
@@ -0,0 +1,18 @@
+// This file was automatically generated from serializers.md by Knit tool. Do not edit.
+package example.exampleSerializer22
+
+import kotlinx.serialization.*
+import kotlinx.serialization.json.*
+import kotlinx.serialization.encoding.*
+import kotlinx.serialization.descriptors.*
+
+// NOT @Serializable
+class Project(val name: String, val language: String)
+
+@Serializer(forClass = Project::class)
+object ProjectSerializer
+
+fun main() {
+ val data = Project("kotlinx.serialization", "Kotlin")
+ println(Json.encodeToString(ProjectSerializer, data))
+}