Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djx314/play-caster
A play 2.5.x extension for circe ( https://github.com/travisbrown/circe )
https://github.com/djx314/play-caster
Last synced: 27 days ago
JSON representation
A play 2.5.x extension for circe ( https://github.com/travisbrown/circe )
- Host: GitHub
- URL: https://github.com/djx314/play-caster
- Owner: djx314
- License: mit
- Created: 2015-08-14T15:39:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-24T04:02:39.000Z (over 8 years ago)
- Last Synced: 2024-10-28T10:10:05.663Z (3 months ago)
- Language: Scala
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A [playframework](https://playframework.com/) 2.5.0 extension for [circe](http://circe.io)
[![Build Status](https://travis-ci.org/scalax/play-caster.svg?branch=master)](https://travis-ci.org/scalax/play-caster)
[![codecov.io](https://codecov.io/github/scalax/play-caster/coverage.svg?branch=master)](https://codecov.io/github/scalax/play-caster?branch=master)To use jfc with play, just import jfc dependencies and copy the code in this repository. Then
```scala
import org.xarcher.caster._
//import play import herecase class Price(id: Option[Long], value: Double)
Action.async { implicit request =>
Future successful Ok(Price(Option(2L, 15.22)).asJson)
}Action.async(JfcParser.json) { implicit request =>
val priceOpt = request.body.as[Price].toOption
...
}
```The code is base on play-json4s . Thanks to @tototoshi .