Good evening folks,
I wanted to let you all know that I've implemented a custom, Scala reflection based extractor for
lift-json's AST. If you're not super familiar with lift-json, extraction is the point at which we take
the json AST (JValue, et al) and turn it into a concrete Scala class (String, class of your
choosing, etc).
The motivation for implementing this extractor came out of some difficulties I run into while
working to add tuple support to lift-json. The code we currently use for extraction relies on
Java reflection and the Scala compiler library. This implementation, by contrast, uses Scala
reflection and provides a much cleaner implementation for much of the same functionality.
This is an **alpha** implementation... it doesn't yet have feature parity with the main lift-json
extractor. For example, it does not support:
- Extracting an Array
- Extracting using custom deserializers
... and probably some other gaps that I don't know about yet.
However! If you've got some fairly straightforward serialization/deserialization needs please
take it for a spin. It's available as a Lift module on Maven Central. You can include it in your
project by adding the following to you build file:
libraryDependencies += "net.liftmodules" %% "json-extractor-ng_3.1" % "0.1.0"
This module requires Scala 2.12.
Try it out, let me know what you think, and file issues for any bugs you find!
Cheers,
Matt