I am trying to simply create a json format for my case classes:
case class ImageRequest (inputs: Array[ImageObject])
case class ImageObject(data: Data)
case class Data(image: Image)
case class Image(url: String)
and here are the implicit formats:
object ApplicationProtocol extends DefaultJsonProtocol {
lazy implicit val ImageRequestFormat = jsonFormat(ImageRequest, "inputs")
lazy implicit val ImageObjectFormat = jsonFormat(ImageObject, "data")
lazy implicit val DataFormat = jsonFormat(Data, "image")
lazy implicit val ImageFormat = jsonFormat(Image, "url")
}
I am getting the error:
> could not find implicit value for evidence parameter of type
> connectors.ClarifaiConnector.ApplicationProtocol.JF[Array[model.ImageObject]]
> [error] lazy implicit val ImageRequestFormat =
> jsonFormat(ImageRequest, "inputs") [error]
> ^ [error]
> /Users/MacZ/Dropbox/Work/Development/JobOffer/ImageProject/src/main/scala/connectors/clarifaiConnector.scala:27:53:
> could not find implicit value for evidence parameter of type
> connectors.ClarifaiConnector.ApplicationProtocol.JF[model.Data]
> [error] lazy implicit val ImageObjectFormat =
> jsonFormat(ImageObject, "data") [error]
> ^ [error]
> /Users/MacZ/Dropbox/Work/Development/JobOffer/ImageProject/src/main/scala/connectors/clarifaiConnector.scala:28:46:
> could not find implicit value for evidence parameter of type
> connectors.ClarifaiConnector.ApplicationProtocol.JF[model.Image]
> [error] lazy implicit val DataFormat = jsonFormat(Data, "image")
> [error] ^
Everything has been imported and appears to be in scope