org.http4s.play.PlayEntityEncoder.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4s-play-json_2.11 Show documentation
Show all versions of http4s-play-json_2.11 Show documentation
Provides Play json codecs for http4s
The newest version!
package org.http4s.play
import cats.Applicative
import play.api.libs.json.Writes
import org.http4s.EntityEncoder
/**
* Derive [[EntityEncoder]] if implicit [[Writes]] is in the scope without need to explicitly call `jsonEncoderOf`
*/
trait PlayEntityEncoder {
implicit def playEntityEncoder[F[_]: Applicative, A: Writes]: EntityEncoder[F, A] =
jsonEncoderOf(EntityEncoder.stringEncoder[F], implicitly, implicitly)
}
object PlayEntityEncoder extends PlayEntityEncoder
© 2015 - 2025 Weber Informatics LLC | Privacy Policy