When I use the following code:
import JsonImpl.graphFormat
val js = Json.toJson(g)(graphFormat)
My code compiles and works fine but when I do this it doesn't work and says: "No Json serializer found for type SGraph. Try to implement an implicit Writes or Format for this type."
import JsonImpl.graphFormat
val js = Json.toJson(g)
JsonImpl is:
object JsonImpl{
implicit val graphFormat = Json.format[SGraph]
}
I don't want to use companion object for my SGraph class. What is the problem and why it cannot find the implicit value?
-Xlog-implicits?