Skip to content

Commit

Permalink
Fix JsonSerializer example in reference guide
Browse files Browse the repository at this point in the history
  • Loading branch information
PPakSang authored and snicoll committed Mar 19, 2022
1 parent 1669062 commit 8536100
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -37,8 +37,10 @@ public static class Serializer extends JsonSerializer<MyObject> {

@Override
public void serialize(MyObject value, JsonGenerator jgen, SerializerProvider serializers) throws IOException {
jgen.writeStartObject();
jgen.writeStringField("name", value.getName());
jgen.writeNumberField("age", value.getAge());
jgen.writeEndObject();
}

}
Expand Down

0 comments on commit 8536100

Please sign in to comment.