The Scaladoc for errors4s-core-circe may be viewed here.
This project provides circe typeclass instances for errors4s-core types.
Add this to your libraryDependencies
in your build.sbt
.
"org.errors4s" %% "errors4s-core-circe" % "1.0.0.0"
import io.circe._
import io.circe.syntax._
import org.errors4s.core._
import org.errors4s.core.circe.instances._
val nes: NonEmptyString = NonEmptyString("A nonempty string")
// nes: NonEmptyString = A nonempty string
val json: Json = nes.asJson
// json: Json = "A nonempty string"
val decodedNes: Decoder.Result[NonEmptyString] = Decoder[NonEmptyString].decodeJson(json)
// decodedNes: Decoder.Result[NonEmptyString] = Right(A nonempty string)
decodedNes == Right(nes)
// res0: Boolean = true
This project uses Package Versioning Policy (PVP). This is to allow long term support (see this discussion). This table lists the currently supported, upcoming, and recently end of life versions.
If you need support for a version combination which is not listed here, please open an issue and we will endeavor to add support for it if possible.
Version | Errors4s Core | Circe Version | Scala 2.11 | Scala 2.12 | Scala 2.13 | Scala 3.0 | Scala 3.1 | Supported |
---|---|---|---|---|---|---|---|---|
2.0.x.x | 1.0.x.x | 0.14.x | No | Yes | Yes | Yes | Yes | Yes |
1.0.x.x | 1.0.x.x | 0.13.x | No | Yes | Yes | No | No | Yes |