do you know how I can return custom object as zio-http
response? I created simple class:
final case class CustomerResponse(id: Int, name: String, age: Int)
object CustomerResponse {
implicit val responseCodec: Codec[CustomerResponse] = deriveCodec[CustomerResponse]
}
and now I would like to return this CustomerResponse as Http response object:
Http.collect[Request] { case Method.GET -> !! / "customer" => // Response.as CustomerResponse
I tried to use
Response.json(CustomerResponse(1, "a", 1))
but it didnt work. Do you know how should I do it?