Circe is a JSON library for Scala (and Scala.js).
Circe is a JSON library for Scala powered by Cats.
A simple usage of this library is:
import io.circe._, io.circe.generic.auto._, io.circe.parser._, io.circe.syntax._
sealed trait Foo
case class Bar(xs: Vector[String]) extends Foo
case class Qux(i: Int, d: Option[Double]) extends Foo
val foo: Foo = Qux(13, Some(14.0))
val json = foo.asJson.noSpaces
println(json) // prints: {"Qux":{"i":13,"d":14}}
val decodedFoo = decode[Foo](json)
println(decodedFoo) // prints: Right(Qux(13,Some(14)))
For reading about it please refer:
- Official documentation: https://circe.github.io/circe/
- Scaladocs: https://circe.github.io/circe/api/
- Source code: https://github.com/circe/circe
- Maven central packages: https://maven-badges.herokuapp.com/maven-central/io.circe/circe-core_2.13
- Gitter: https://gitter.im/circe/circe