|
@@ -9,6 +9,7 @@ import java.time.LocalTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Date;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.context.annotation.Primary;
|
|
@@ -98,6 +99,14 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>() {
|
|
|
+ @Override
|
|
|
+ public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
|
|
+ if (o instanceof String) {
|
|
|
+ jsonGenerator.writeString(StringUtils.EMPTY);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
objectMapper.registerModule(javaTimeModule);
|
|
|
return objectMapper;
|