Error using json with scala 2.11...

124 views
Skip to first unread message

carlos L

unread,
Sep 10, 2014, 8:16:30 PM9/10/14
to raptur...@googlegroups.com
Hi guys...is nice see than this project is still active, I discovered it a year ago and seemed a bit inactive, I feel than this is a little scala gem than many people don't know..

now..the bad parts....

I'm trying use the json parser, I import rapture.io._ and discovered than doesn't appear any json in any place...after look the scaladoc and visit this group I discovered than I need import rapture.json._ ...would be nice than it was documented 

now I get this error
<console>:58: error: could not find implicit value for evidence parameter of type rapture.json.JsonParser[String]
              Json.parse(qr)


seems than I need  import jsonParsers.scalaJson but I'm using scala 2.11 and not 2.10...what can I do?? I cant use scala 2.10 now so I need other alternative, thanks...


Jon Pretty

unread,
Sep 12, 2014, 5:17:24 AM9/12/14
to raptur...@googlegroups.com
Hi Carlos,

Work on Rapture is still very active, though there's still a bit of work to get the documentation and release process up to date. In a few weeks' time I'll actually be working full time on it.

So, the imports are critical. In older versions, the `rapture.io` package contained everything, though much of the work over the last year has been to modularize the library, so you can now use the JSON library without the IO library.

Much work -- though it remains incomplete -- has also gone into supporting different JSON backends, that is, the parser and AST representation of the JSON. I have working versions of Argonaut, Lift JSON, JSON4S, Jackson and Jawn backends, though not all of these have been published to Maven Central yet. I hope I'll have time to publish soon, though more testing is required before I do.

What's released right now for Scala 2.11 are the backends for Jawn and Jackson. Unfortunately, the former is built against a snapshot of Jawn (and you'll have to provide your own Jawn JAR), and the latter does not yet support mutable JSON. If you don't need mutable JSON, then I'd recommend the Jackson backend.  You'll need to include a dependency on com.propensive / rapture-json-jackson_2.11 / 0.9.0, and you'll need this import:

   import rapture.json.jsonParsers.jackson._

I appreciate the process isn't quite as simple as it ought to be, but I hope you'll stick with it until I can get the next release (with the different backend support) out the door!

Cheers,
Jon

--
You received this message because you are subscribed to the Google Groups "Rapture users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rapture-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jon Pretty | @propensive
Reply all
Reply to author
Forward
0 new messages