propensive / rapture

Rapture
183 stars 39 forks source link

document how to parse a case class with rapture-json 2 #278

Open tyrcho opened 6 years ago

tyrcho commented 6 years ago

I've tried to migrate my sample to rapture 2.0 M9 but I cannot find the correct way to do it, here is a minimalist sample: https://github.com/tyrcho/rapture-json-demo/blob/rapture_2/src/main/scala/Demo.scala

this code worked with rapture 1.1 (my master branch)

Json.parse(string).as[Person]

but fails with rapture 2 (branch rapture_2):

Error:(16, 32) not enough arguments for method as: (implicit ext: rapture.data.Extractor[Demo.Person,rapture.json.Json], implicit mode: rapture.core.Mode[rapture.data.Data#as])mode.Wrap[Demo.Person,ext.Throws].
Unspecified value parameters ext, mode.
  val p = Json.parse(string).as[Person]