title: Implicit Json Formatter for value classes in Scala
body: <p>I have many value classes that make up a larger object case class.</p>
  <pre><code>final case class TopLevel(
    foo: Foo,
    bar: Bar
  )
  
  final case class Foo(foo: String) extends AnyVal
  
  final case class Bar(bar: String) extends AnyVal
  
  object Foo {
    implicit val format = Json.valueFormat[Foo]
  }
  
  object Bar {
    implicit val format = Json.valueFormat[Bar]
  }
  
  object TopLevel {
    implicit val TopLevelFormat: OFormat[TopLevel] = Json.format[TopLevel]
  }
  </code></pre>
  <p>This works fine, but when the top level case class has many arguments the construction objects soon pile up. I tried to do this implicitly, e.g.</p>
  <pre><code>object Format {
    implicit def jsonFormatter[A](): Format[A] = Json.valueFormat[A]
  }
  </code></pre>
  <p>But I get</p>
  <pre><code>scala.ScalaReflectionException: &lt;none&gt; is not a method
  </code></pre>