title: Play Json Single Field Reads Validator
body: <p>I'm trying to add simple validation to incoming Json in Play. Based on <a href="https://stackoverflow.com/a/26317869/306149">this question</a>, I tried writing:</p>
  
  <pre><code>case class ApiData(data: String)
  
  def maxLengthValidator = Reads.StringReads.filter(ValidationError("Error"))(_.length &lt; 100)
  
  implicit val ApiDataReads: Reads[ApiData] = (
    (JsPath \ "data").read[String](maxLengthValidator)
  )(ApiData.apply _)
  </code></pre>
  
  <p>This does not compile, producing the error: </p>
  
  <pre><code>type mismatch;
  [error]  found   : String =&gt; ApiData
  [error]  required: play.api.libs.json.Reads[?]
  [error]     )(ApiData.apply _)
  [error]                        ^
  [error] one error found
  </code></pre>
  
  <p>But if I add a second field, it does compile:</p>
  
  <pre><code>case class ApiData(data: String, __doNotUse: Option[Int])
  
  implicit val ApiDataReads: Reads[ApiData] = (
    (JsPath \ "data").read[String](maxLengthValidator) and
    (JsPath \ "__doNotUse").readNullable[Int]
  )(ApiData.apply _)
  </code></pre>
  
  <p>What do I need to do to get this working with just a single field?</p>