Better compile-time diagnostics when attempting to extract case classes from JSON
| scala> case class Bar(file: java.io.File) // We can't extract a File | |
| defined class Bar | |
| scala> case class Foo(bar: Bar) // therefore we can't extract a Bar | |
| defined class Foo | |
| scala> json""{ "bar": { "file": "..." } }""".as[Foo] | |
| Could not generate a Json extractor for case class Bar because a Json extractor for parameter `file' of type java.io.File could not be found | |
| Could not generate a Json extractor for case class Foo because a Json extractor for parameter `bar' of type Bar could not be found | |
| <console>:21: error: cannot extract type Foo from rapture.json.Json. | |
| json"""{ "bar": { "file": "..." } }""".as[Foo] | |
| ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment