From 8536100009c8f9602ef211246c7c32cd2561af19 Mon Sep 17 00:00:00 2001 From: SangHyun-Park <51109514+PPakSang@users.noreply.github.com> Date: Sat, 19 Mar 2022 15:56:49 +0900 Subject: [PATCH 1/2] Fix JsonSerializer example in reference guide See gh-30329 --- .../springmvc/json/MyJsonComponent.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java index 44fea4b648d2..e0e232a0278a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java @@ -37,8 +37,10 @@ public static class Serializer extends JsonSerializer { @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(); } } From 39339ccb49c132620d41cfbf4bfcef4402556ed0 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 19 Mar 2022 09:25:46 +0100 Subject: [PATCH 2/2] Update copyright year of change file See gh-30329 --- .../springmvc/json/MyJsonComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java index e0e232a0278a..9f739e3ed337 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/json/MyJsonComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.