Class JacksonConfig

java.lang.Object
me.josephsf.jobportaljosephsfeir.config.JacksonConfig

@Configuration public class JacksonConfig extends Object
Configuration class for Jackson ObjectMapper customization.

This class registers the JavaTimeModule to properly handle Java 8 date and time types like LocalDateTime, LocalDate, etc. It also configures the ObjectMapper to not write dates as timestamps.

Since:
2025-05-17
  • Constructor Details

    • JacksonConfig

      public JacksonConfig()
  • Method Details

    • objectMapper

      @Bean @Primary public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
      Creates and configures the ObjectMapper with support for Java 8 date/time types.

      This bean is marked as @Primary to ensure it overrides any other ObjectMapper beans defined by Spring Boot's auto-configuration.

      Returns:
      A configured ObjectMapper instance with JavaTimeModule registered