https://github.com/liftmodules/json-extractor-ng
A JValue extractor for lift-json based on Scala reflection
https://github.com/liftmodules/json-extractor-ng
Last synced: 5 months ago
JSON representation
A JValue extractor for lift-json based on Scala reflection
- Host: GitHub
- URL: https://github.com/liftmodules/json-extractor-ng
- Owner: liftmodules
- License: apache-2.0
- Created: 2017-03-21T02:14:54.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T04:53:07.000Z (over 8 years ago)
- Last Synced: 2025-12-22T22:21:16.925Z (6 months ago)
- Language: Scala
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-extractor-ng
This project is a new extractor for lift-json based on Scala reflection instead of
Java reflection. Currently, it requires Scala 2.12 and only works against Lift 3.1 or 3.2.
To use it, you'll just need to add a line to your build file. For the Lift 3.1 edition simply
add:
```scala
libraryDependencies += "net.liftmodules" %% "json-extractor-ng_3.1" % "0.3.0"
```
For the Lift 3.2 edition:
```scala
libraryDependencies += "net.liftmodules" %% "json-extractor-ng_3.2" % "0.3.0"
```
Once it's set up, import the `Extraction` implicit conversions and use the
`extractNg` method to extract using this extractor instead of the default Lift
extraction.
```scala
import net.liftweb.json._
import net.liftweb.json.JsonDSL._
import net.liftmodules.jsonextractorng.Extraction._
case class Thing(name: String, age: Int)
implicit val formats = DefaultFormats
val myJValue = ("name" -> "Bob") ~ ("age" -> 500)
myJValue.extractNg[Thing] // => Thing("Bob", 500)
```
## Known Issues
None (yet)