Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example of implementing a custom Jackson object mapper provider for Scala
import{ContextResolver, Provider}
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
class CustomObjectMapperProvider extends ContextResolver[ObjectMapper] {
def getContext(tpe: Class[_]): ObjectMapper = {
if (tpe != classOf[ObjectMapper]) null
else {
val m = new ObjectMapper()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment