- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Description
Leon Radley opened SPR-12983 and commented
If I overwrite SpringBootRepositoryRestMvcConfiguration to enable some extra conf (simplified in the example below) the jsr-310 / jdk8 jackson modules are not being used
@Configuration
public class RestConfig extends SpringBootRepositoryRestMvcConfiguration {
    @Override
    protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
        config.setBasePath("/restapi");
        config.setReturnBodyOnCreate(true);
    }
}As soon as I remove the RestConfig class the modules are in use and the dates come out right.
I've created a demo repo.
https://github.com/leon/temp-spring-boot-data-rest-jackson-problem
Another strange thing is that the JSR-310 module gets autoregistered, but the JDK8Module doesn't
so I need to add it explicitly?!
1. Solution
Can we somehow wait for the jackson auto configuration to complete before creating the rest object mapper, or even better why not use the same object mapper?
Affects: 4.1.6
Reference URL: spring-projects/spring-boot#2914
Issue Links:
- Http message conversion not finding Jackson JDK8 module in context [SPR-13049] #17641 Http message conversion not finding Jackson JDK8 module in context