Skip to content

Commit

Permalink
Kotlin Fix JsonSerializer example in reference guide
Browse files Browse the repository at this point in the history
Closes gh-30331
  • Loading branch information
wilkinsona committed Mar 19, 2022
1 parent d8bb2ec commit f05c19a
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit f05c19a

Please sign in to comment.