Skip to content

Commit 5e73a68

Browse files
committed
GH-1148 Add JavaTimeModule to ObjectMapper
1 parent 8b66fd2 commit 5e73a68

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

spring-cloud-function-context/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
<artifactId>jackson-databind</artifactId>
6262
<optional>true</optional>
6363
</dependency>
64+
<dependency>
65+
<groupId>com.fasterxml.jackson.datatype</groupId>
66+
<artifactId>jackson-datatype-jsr310</artifactId>
67+
</dependency>
6468
<dependency>
6569
<groupId>org.springframework.boot</groupId>
6670
<artifactId>spring-boot-starter-test</artifactId>

spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/config/ContextFunctionCatalogAutoConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.fasterxml.jackson.databind.DeserializationFeature;
2828
import com.fasterxml.jackson.databind.ObjectMapper;
2929
import com.fasterxml.jackson.databind.SerializationFeature;
30+
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
3031
import com.google.gson.Gson;
3132
import io.cloudevents.spring.messaging.CloudEventMessageConverter;
3233

@@ -215,6 +216,7 @@ private JsonMapper gson(ApplicationContext context) {
215216

216217
private JsonMapper jackson(ApplicationContext context) {
217218
ObjectMapper mapper = new ObjectMapper();
219+
mapper.registerModule(new JavaTimeModule());
218220
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
219221
mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
220222
return new JacksonMapper(mapper);

0 commit comments

Comments
 (0)