I have a user model
case class User(name: String, email: String, password: Option[String] = None, key: Option[UUID] = None)
With marshaler spray
object UserJsonSupport extends DefaultJsonProtocol with SprayJsonSupport {
implicit val userFormat = jsonFormat4(User)
}
It worked until I reworked the key field from Option[String]to Option[UUID], and now I get two compilation errors:
Error:(8, 40) could not find implicit value for evidence parameter of type in.putfood.http.UserJsonSupport.JF[Option[java.util.UUID]]
implicit val userFormat = jsonFormat4(User)
^
Error:(8, 40) not enough arguments for method jsonFormat4: (implicit evidence$16: in.putfood.http.UserJsonSupport.JF[String], implicit evidence$17: in.putfood.http.UserJsonSupport.JF[String], implicit evidence$18: in.putfood.http.UserJsonSupport.JF[Option[String]], implicit evidence$19: in.putfood.http.UserJsonSupport.JF[Option[java.util.UUID]], implicit evidence$20: ClassManifest[in.putfood.model.User])spray.json.RootJsonFormat[in.putfood.model.User].
Unspecified value parameters evidence$19, evidence$20.
implicit val userFormat = jsonFormat4(User)
^
I realized that since this problem was resolved, it should work without the need to provide my own UUID non-serializer. Am I mistaken or is it completely different?
Is it possible that he does not like being inside Option?
source
share