Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically register Jackson's JDK 8 module when available [SPR-12983] #17574

Closed
spring-issuemaster opened this issue May 5, 2015 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented May 5, 2015

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:

  • #17641 Http message conversion not finding Jackson JDK8 module in context
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented May 5, 2015

Andy Wilkinson commented

In my opinion, the only part of this that is relevant to Spring Framework is the automatic registration of Jackson's JDK 8 module and, therefore, it's really an enhancement request rather than a bug. It was discussed as an enhancement to Jackson2ObjectMapper builder in spring-projects/spring-boot#2789.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented May 7, 2015

Sébastien Deleuze commented

Automatic registration of Jackson's JDK 8 module is now merged in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.