In my Scala Spray.io application, I would like to turn some Joda LocalTime
and LocalDate
objects into JSON. This is apparently done by adding JodaTime support from Json4s to the DefaultFormats
as follows:
object Json4sProtocol extends Json4sSupport {
implicit def json4sFormats: Formats = org.json4s.DefaultFormats ++ org.json4s.ext.JodaTimeSerializers.all
}
But for some reason, I'm unable to access the ext
package: object ext is not a member of package org.json4s
. Any ideas why this can happen?
I'm well aware that it may be some problem in the way I load the dependencies. I added this line to my build.sbt
:
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-jackson" % "3.2.11",
...
)