Reputation: 7468
I am following this. I have defined JsonFormat for my custom case class as:
object RecipeJsonProtocol extends DefaultJsonProtocol {
implicit val recipeFormat = jsonFormat4(Recipe.apply)
}
...and then used it as following in same file:
import RecipeJsonProtocol._
def postRecipe(recipe: Recipe): Callback = {
val json = recipe.toJson.toString()
Ajax.post(url = "....", data = json).onComplete {
case Success(xhr) => println("....")
case Failure(t) => println("An error has occurred: " + t.getMessage)
}
Callback.empty
}
But this is throwing error as:
[error] Referring to non-existent class spray.json.package$
What's wrong here?
Upvotes: 0
Views: 87