Skip to content

Commit 01c3fb0

Browse files
Lars Bilgerolegz
Lars Bilger
authored andcommitted
Revert "GH-1148 Configure our own ObjectMapper"
This reverts commit 8b66fd2
1 parent 1686e24 commit 01c3fb0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,14 @@ private JsonMapper gson(ApplicationContext context) {
214214
}
215215

216216
private JsonMapper jackson(ApplicationContext context) {
217-
ObjectMapper mapper = new ObjectMapper();
218-
mapper.registerModule(new JavaTimeModule());
217+
ObjectMapper mapper;
218+
try {
219+
mapper = context.getBean(ObjectMapper.class);
220+
}
221+
catch (Exception e) {
222+
mapper = new ObjectMapper();
223+
}
224+
mapper.registerModule(new JavaTimeModule());
219225
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
220226
mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
221227
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

0 commit comments

Comments
 (0)