zio-json

zio-json

  • Overview
  • Interop modules
  • API
  • About

›Interop

Interop

  • Interop modules
  • Akka Http Interop
  • HTTP4s Interop
  • Refined Interop
  • Scalaz 7.x Interop

HTTP4s Interop

An interop module is provided for HTTP4s v0.21

Installation

libraryDependencies ++= Seq(
  "dev.zio" % "zio-json-interop-http4s" % "can't find release"
)

Usage

import zio.json._
import zio.json.interop.http4s._

final case class Greeting(greeting: String)

object Greeting {
  // This JsonCodec[A] will be picked up by the `jsonEncoderOf` method provided by zio-json-interop-http4s
  implicit val encoder: JsonCodec[Greeting] =
    DeriveJsonCodec.gen

  implicit def entityEncoder[F[_]: Applicative]: EntityEncoder[F, Greeting] =
    jsonEncoderOf[F, Greeting]
}

Example project

A fully working example project can be found here

← Akka Http InteropRefined Interop →
  • Installation
  • Usage
  • Example project
zio-json
GitHub
Star
Chat with us on Discord
discord
Additional resources
Scaladoc of zio-json
Copyright © 2022 ZIO Maintainers