Jay Taylor's notes

back to listing index

Writing custom de/serializers for Jerkson, Jackson in scala with Play framework

[web search]
Original source (logician.free.fr)
Tags: logician.free.fr
Clipped on: 2012-08-10
object CustomJson extends com.codahale.jerkson.Json {
  val module = new SimpleModule("CustomJson", Version.unknownVersion())
  module.addSerializer(classOf[ObjectId], new ObjectIdSerializer)
  module.addDeserializer(classOf[ObjectId], new ObjectIdDeserializer)
  mapper.registerModule(module)
}