Error in executing pattern matching example

18 views
Skip to first unread message

Chetan Conikee

unread,
Jul 22, 2014, 1:37:16 PM7/22/14
to raptur...@googlegroups.com

Attempted to execute this example snippet from http://rapture.io/jsonSupport

val fruits = Json.parse("""[
{
"name": "Bushkin",
"kind": "pumpkin",
"sweet": false
},
{
"name": "Braeburn",
"kind": "apple",
"sweet": true
}
]""").get[List[Json]]

and receiving the following errors:

console>:17: error: method selectDynamic: (key: String)rapture.json.Json does not take type parameters.
error after rewriting to rapture.json.Json.parseString(rapture.json.jsonParsers.scalaJson.package.scalaJsonParser, rapture.core.strategy.throwExceptions).selectDynamicList[Json]
possible cause: maybe a wrong Dynamic method signature?
val fruits = Json.parse("""[

Again, am I missing anything here?

Jon Pretty

unread,
Jul 22, 2014, 8:21:34 PM7/22/14
to raptur...@googlegroups.com
Hi Chetan,


On Tuesday, 22 July 2014 18:37:16 UTC+1, Chetan Conikee wrote:

Attempted to execute this example snippet from http://rapture.io/jsonSupport

You've stumbled across some old documentation! There was a change between versions 0.8.x and 0.9.x where the `get` method becomes `as`. I've looked through that page, and I think that's the only difference. I've also corrected it now.

Thanks for pointing this out - replacement documentation for Rapture JSON and IO is in the works, and an increasingly high priority, so hopefully discrepancies like this will become fewer. Much appreciated!

Thanks,
Jon
Reply all
Reply to author
Forward
0 new messages