Skip to content

Instantly share code, notes, and snippets.

@lynas
Created May 22, 2016 17:06
Show Gist options
  • Save lynas/15ed8a3194c221563b55bf44363053f7 to your computer and use it in GitHub Desktop.
Save lynas/15ed8a3194c221563b55bf44363053f7 to your computer and use it in GitHub Desktop.
Jackson Kotlin Module
Jackson Kotlin Module
If you are using Jackson you are likely to want to add com.fasterxml.jackson.module:jackson-module-kotlin dependency in order to allow it to deal with data classes with no default constructor or with Kotlin collections.
In addition to the dependency, you need to register it in Jackson ObjectMapper:
@SpringBootApplication
open class Application {
@Bean
open fun objectMapperBuilder(): Jackson2ObjectMapperBuilder
= Jackson2ObjectMapperBuilder().modulesToInstall(KotlinModule())
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment