Skip to content

Commit

Permalink
Revert "spring-cloudGH-1148 Configure our own ObjectMapper"
Browse files Browse the repository at this point in the history
This reverts commit 8b66fd2
  • Loading branch information
Lars Bilger committed Jul 17, 2024
1 parent 76d9278 commit 681bd61
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,14 @@ private JsonMapper gson(ApplicationContext context) {
}

private JsonMapper jackson(ApplicationContext context) {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule());
ObjectMapper mapper;
try {
mapper = context.getBean(ObjectMapper.class);
}
catch (Exception e) {
mapper = new ObjectMapper();
}
mapper.registerModule(new JavaTimeModule());
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
return new JacksonMapper(mapper);
Expand Down

0 comments on commit 681bd61

Please sign in to comment.