Created
August 6, 2015 08:08
-
-
Save propensive/ffe59d36509cc40272b0 to your computer and use it in GitHub Desktop.
Rapture JSON erorrs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import rapture.json._ | |
import rapture.json._ | |
scala> import jsonBackends.jawn._ | |
import jsonBackends.jawn._ | |
scala> case class Foo(bar: String, baz: Int) | |
defined class Foo | |
scala> case class Quux(foo: Foo, bippy: Double) | |
defined class Quux | |
scala> json"""{ "foo": { }, "bippy": 42 }""" | |
res0: rapture.json.Json = {"bippy":42,"foo":{}} | |
scala> import rapture.core.modes.returnResult._ | |
import rapture.core.modes.returnResult._ | |
scala> res0.as[Quux] | |
res1: rapture.core.Result[Quux,rapture.data.DataGetException with rapture.data.DataGetException] = | |
Errata( | |
Vector(rapture.data.DataGetException: missing value [_.foo.bar], rapture.data.DataGetException: missing value [_.foo.baz]) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment