Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play error: value and is not a member of play.api.libs.json

This is the code I am using:

(__ \ "fields").read(
  (__ \ "key").readNullable[String] and
  (__ \ "summary").readNullable[String] and
  (__ \ "description").readNullable[String]
  tupled
)

The complete error in this case is:

value and is not a member of play.api.libs.json.Reads[Option[String]]

It could also have been one of these in the error

play.api.libs.json.OFormat
play.api.libs.json.OWrites
like image 410
EECOLOR Avatar asked Feb 27 '13 14:02

EECOLOR


1 Answers

The solution is to import functional syntax

import play.api.libs.functional.syntax._
like image 124
EECOLOR Avatar answered Oct 13 '22 20:10

EECOLOR