type mismatch error when creating Reads for Play 2.1

吃可爱长大的小学妹 提交于 2019-12-02 01:05:31
Alex Yarmula

This should work:

implicit val regReads: Reads[Registration] = (__ \ "user").read(
    (__ \ "id").read[String] and
      (__ \ "username").read[String] and
      (__ \ "first_name").read[String] and
      (__ \ "last_name").read[String] and
      (__ \ "email_address").read[String] and
      (__ \ "user_avatar").read[String]
      tupled
  ) map Registration.apply _

See this question for more information.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!