Skip to content

Commit

Permalink
Update HttpContentCodec.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 authored Aug 31, 2024
1 parent 99c240c commit b9a7c07
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sealed trait HttpContentCodec[A] { self =>
* A right biased merge of two HttpContentCodecs.
*/
def ++(that: HttpContentCodec[A]): HttpContentCodec[A] =
Default(choices ++ that.choices)
HttpContentCodec.Default(choices ++ that.choices)

def decodeRequest(request: Request, config: CodecConfig): Task[A] = {
val contentType = mediaTypeFromContentTypeHeader(request)
Expand Down Expand Up @@ -77,7 +77,7 @@ sealed trait HttpContentCodec[A] { self =>
}

def only(mediaType: MediaType): HttpContentCodec[A] =
Filtered(this, mediaType)
HttpContentCodec.Filtered(this, mediaType)

def only(mediaType: Option[MediaType]): HttpContentCodec[A] =
mediaType.map(only).getOrElse(self)
Expand Down Expand Up @@ -163,7 +163,7 @@ object HttpContentCodec {

implicit def fromSchema[A](implicit schema: Schema[A]): HttpContentCodec[A] =
schemaCache
.getOrElseUpdate(schema, _ => json.only[A] ++ protobuf.only[A] ++ text.only[A])
.getOrElseUpdate(schema, _: Schema[A] => json.only[A] ++ protobuf.only[A] ++ text.only[A])
.asInstanceOf[HttpContentCodec[A]]

final private case class Default[A](
Expand Down

0 comments on commit b9a7c07

Please sign in to comment.