26

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
EECOLOR
  • 11,184
  • 3
  • 41
  • 75

1 Answers1

54

The solution is to import functional syntax

import play.api.libs.functional.syntax._
EECOLOR
  • 11,184
  • 3
  • 41
  • 75
  • 2
    FWIW, Intellij doesn't recognize that the `syntax` package is actually being used and auto-removes it for me. However, everything works as expected with SBT. Thanks EECOLOR! – advait Feb 18 '15 at 00:12