Skip to content

Commit

Permalink
fix compilation && fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Nov 26, 2024
1 parent f2a669f commit 462d3d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions zio-http/shared/src/main/scala/zio/http/endpoint/Endpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
codecError: HttpCodec[HttpCodecType.ResponseType, HttpCodecError],
documentation: Doc,
authType: Auth,
) { self =>
) {
self =>

val authCombiner: Combiner[Input, authType.ClientRequirement] =
implicitly[Combiner[Input, authType.ClientRequirement]]
Expand All @@ -67,6 +68,7 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
): HttpCodec[HttpCodecType.RequestType, AuthedInput] = {
input ++ authCodec
}.asInstanceOf[HttpCodec[HttpCodecType.RequestType, AuthedInput]]

type AuthedInput = authCombiner.Out

/**
Expand Down Expand Up @@ -310,8 +312,10 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
}

// TODO: What to do if there are no endpoints??
def handlers2(handlers: Chunk[(Handler[Env, Nothing, Request, Response], HttpCodec.Fallback.Condition)]) = {
def noFound =
def handlers2(
handlers: Chunk[(Handler[Env, Nothing, Request, Response], HttpCodec.Fallback.Condition)],
): NonEmptyChunk[(Handler[Env, Response, Request, Response], HttpCodec.Fallback.Condition)] = {
def noFound: NonEmptyChunk[(Handler[Env, Response, Request, Response], HttpCodec.Fallback.Condition)] =
NonEmptyChunk(
Handler.fail(zio.http.Response(status = Status.NotFound)) -> HttpCodec.Fallback.Condition.IsHttpCodecError,
)
Expand Down

0 comments on commit 462d3d4

Please sign in to comment.