Kotlin Fix JsonSerializer example in reference guide

Closes gh-30331
pull/30406/head
Andy Wilkinson 3 years ago
parent d8bb2ec4e0
commit f05c19a40a

@ -34,8 +34,10 @@ class MyJsonComponent {
class Serializer : JsonSerializer<MyObject>() {
@Throws(IOException::class)
override fun serialize(value: MyObject, jgen: JsonGenerator, serializers: SerializerProvider) {
jgen.writeStartObject()
jgen.writeStringField("name", value.name)
jgen.writeNumberField("age", value.age)
jgen.writeEndObject()
}
}

Loading…
Cancel
Save