DATAREST-899 - Prefer user registered modules over default ones.
We now issue the user registration of Jackson modules before any of the default modules Spring Data registers get applied. Testing module registration seems to be rather difficult as Jackson doesn't actually expose API to do so. An issue [0] was filed for Jackson to improve on this. [0] https://github.com/FasterXML/jackson-databind/issues/1478
This commit is contained in:
@@ -828,6 +828,10 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true);
|
||||
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
// Configure custom Modules
|
||||
configurerDelegate.configureJacksonObjectMapper(objectMapper);
|
||||
|
||||
objectMapper.registerModule(geoModule);
|
||||
|
||||
if (config().isEnableEnumTranslation()) {
|
||||
@@ -835,8 +839,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
|
||||
}
|
||||
|
||||
Jackson2DatatypeHelper.configureObjectMapper(objectMapper);
|
||||
// Configure custom Modules
|
||||
configurerDelegate.configureJacksonObjectMapper(objectMapper);
|
||||
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user