Trying to compile this small ZIO friendly Tapir/Http4s Endpoint description
import io.circe.generic.auto._
import org.http4s.HttpRoutes
import sttp.tapir.json.circe
import sttp.tapir.ztapir._
import sttp.tapir.server.http4s.ztapir._
import sttp.tapir.endpoint
import zio.RIO
import zio.interop.catz._
case class HealthReplyDTO(message: String)
final class HealthEndpointZTapir[E]() {
private val prefixPath = "/health"
val healthOkReply = HealthReplyDTO("OK")
private val routeDescription: ZEndpoint[Unit, Unit, HealthReplyDTO] =
endpoint.get.in(prefixPath).out(circe.jsonBody[HealthReplyDTO]).description("Health Endpoint")
val route: HttpRoutes[RIO[E, *]]
= routeDescription.toRoutes( _ => RIO.succeed(healthOkReply))
}
and keep getting this on the last line.
Type mismatch. Required: HttpRoutes[RIO[E, *]], found: HttpRoutes[zio.Task]
A Task is a sub type of RIO so this should work fine right? Or am I missing something here. A bit of a noob to this world, so some help would be much appreciated.