Skip to content

Commit bce247e

Browse files
committed
Merge branch '2.5.x' into 2.6.x
Closes gh-30330
2 parents e49de1f + 1f010a7 commit bce247e

File tree

1 file changed

+3
-1
lines changed
  • spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/json

1 file changed

+3
-1
lines changed

spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/json/MyJsonComponent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,8 +37,10 @@ public static class Serializer extends JsonSerializer<MyObject> {
3737

3838
@Override
3939
public void serialize(MyObject value, JsonGenerator jgen, SerializerProvider serializers) throws IOException {
40+
jgen.writeStartObject();
4041
jgen.writeStringField("name", value.getName());
4142
jgen.writeNumberField("age", value.getAge());
43+
jgen.writeEndObject();
4244
}
4345

4446
}

0 commit comments

Comments
 (0)