GH-1148 Add JavaTimeModule to ObjectMapper
This commit is contained in:
@@ -61,6 +61,10 @@
|
|||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
|
|||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import io.cloudevents.spring.messaging.CloudEventMessageConverter;
|
import io.cloudevents.spring.messaging.CloudEventMessageConverter;
|
||||||
|
|
||||||
@@ -215,6 +216,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
|||||||
|
|
||||||
private JsonMapper jackson(ApplicationContext context) {
|
private JsonMapper jackson(ApplicationContext context) {
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
mapper.registerModule(new JavaTimeModule());
|
||||||
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
||||||
mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
|
mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
|
||||||
return new JacksonMapper(mapper);
|
return new JacksonMapper(mapper);
|
||||||
|
|||||||
Reference in New Issue
Block a user