ResponseDecoder

smithy4s.http4s.kernel.ResponseDecoder$

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Types

type CachedCompiler[F[_]] = CachedSchemaCompiler[[_] =>> ResponseDecoder[F, _$2]]

Value members

Concrete methods

def discriminating[F[_] : Concurrent, Discriminator, E](discriminate: Response[F] => F[Option[Discriminator]], select: Discriminator => Option[ResponseDecoder[F, E]]): ResponseDecoder[F, E]

Creates a response decoder that dispatches the response to a given decoder, based on some discriminator.

Creates a response decoder that dispatches the response to a given decoder, based on some discriminator.

Attributes

def forError[F[_] : Concurrent, E](maybeErrorable: Option[Errorable[E]], decoderCompiler: CachedSchemaCompiler[[_] =>> ResponseDecoder[F, _$4]], discriminate: Response[F] => F[Option[HttpDiscriminator]]): ResponseDecoder[F, E]

Creates a response decoder that dispatches the response to the correct alternative, based on some discriminator.

Creates a response decoder that dispatches the response to the correct alternative, based on some discriminator.

Attributes

def forErrorAsThrowable[F[_] : Concurrent, E](maybeErrorable: Option[Errorable[E]], decoderCompiler: CachedSchemaCompiler[[_] =>> ResponseDecoder[F, _$6]], discriminate: Response[F] => F[Option[HttpDiscriminator]]): ResponseDecoder[F, Throwable]

Creates a response decoder that dispatches the response to the correct alternative, based on some discriminator, and then upcasts the error as a throwable

Creates a response decoder that dispatches the response to the correct alternative, based on some discriminator, and then upcasts the error as a throwable

Attributes

def fromMetadataDecoder[F[_] : MonadThrow, A](metadataDecoder: Decoder[A]): ResponseDecoder[F, A]

Creates a ResponseDecoder that decodes an HTTP message by looking at the metadata.

Creates a ResponseDecoder that decodes an HTTP message by looking at the metadata.

NB: This decoder assumes that incoming requests have been enriched with pre-extracted path-parameters in the vault.

Attributes

def fromMetadataDecoderK[F[_] : MonadThrow]: PolyFunction[Decoder, [_] =>> ResponseDecoder[F, _$11]]
def restSchemaCompiler[F[_]](metadataDecoderCompiler: CachedSchemaCompiler[Decoder], entityDecoderCompiler: CachedSchemaCompiler[[_] =>> EntityDecoder[F, _$14]])(implicit F: Concurrent[F]): CachedSchemaCompiler[[_] =>> ResponseDecoder[F, _$15]]

A compiler for ResponseDecoder that abides by REST-semantics : fields that are annotated with httpLabel, httpHeader, httpQuery, httpStatusCode ... are decoded from the corresponding metadata.

A compiler for ResponseDecoder that abides by REST-semantics : fields that are annotated with httpLabel, httpHeader, httpQuery, httpStatusCode ... are decoded from the corresponding metadata.

The rest is decoded from the body.

Attributes