Unmarshaller

org.apache.pekko.http.scaladsl.unmarshalling.Unmarshaller
See theUnmarshaller companion trait

Attributes

Companion
trait
Source
Unmarshaller.scala
Graph
Supertypes
Self type

Members list

Type members

Classlikes

final case class EitherUnmarshallingException(rightClass: Class[_], right: Throwable, leftClass: Class[_], left: Throwable) extends RuntimeException

Order of parameters (right first, left second) is intentional, since that's the order we evaluate them in.

Order of parameters (right first, left second) is intentional, since that's the order we evaluate them in.

Attributes

Source
Unmarshaller.scala
Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final implicit class EnhancedFromEntityUnmarshaller[A](val underlying: FromEntityUnmarshaller[A]) extends AnyVal

Attributes

Source
Unmarshaller.scala
Supertypes
class AnyVal
trait Matchable
class Any
final implicit class EnhancedUnmarshaller[A, B](val um: Unmarshaller[A, B]) extends AnyVal

Attributes

Source
Unmarshaller.scala
Supertypes
class AnyVal
trait Matchable
class Any

Signals that unmarshalling failed because the entity was unexpectedly empty.

Signals that unmarshalling failed because the entity was unexpectedly empty.

Attributes

Source
Unmarshaller.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Product
trait Equals
trait NoStackTrace
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type

Signals that unmarshalling failed because the entity content-type did not match one of the supported ranges. This error cannot be thrown by custom code, you need to use the forContentTypes modifier on a base pekko.http.scaladsl.unmarshalling.Unmarshaller instead.

Signals that unmarshalling failed because the entity content-type did not match one of the supported ranges. This error cannot be thrown by custom code, you need to use the forContentTypes modifier on a base pekko.http.scaladsl.unmarshalling.Unmarshaller instead.

Attributes

Companion
object
Source
Unmarshaller.scala
Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
Unmarshaller.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def apply[A, B](f: ExecutionContext => A => Future[B]): Unmarshaller[A, B]

Creates an Unmarshaller from the given function.

Creates an Unmarshaller from the given function.

Attributes

Source
Unmarshaller.scala

Returns the best charset for unmarshalling the given entity to a character-based representation. Falls back to UTF-8 if no better alternative can be determined.

Returns the best charset for unmarshalling the given entity to a character-based representation. Falls back to UTF-8 if no better alternative can be determined.

Attributes

Source
Unmarshaller.scala
def firstOf[A, B](unmarshallers: Unmarshaller[A, B]*): Unmarshaller[A, B]

Helper for creating a "super-unmarshaller" from a sequence of "sub-unmarshallers", which are tried in the given order. The first successful unmarshalling of a "sub-unmarshallers" is the one produced by the "super-unmarshaller".

Helper for creating a "super-unmarshaller" from a sequence of "sub-unmarshallers", which are tried in the given order. The first successful unmarshalling of a "sub-unmarshallers" is the one produced by the "super-unmarshaller".

Attributes

Source
Unmarshaller.scala
def strict[A, B](f: A => B): Unmarshaller[A, B]

Helper for creating a synchronous Unmarshaller from the given function.

Helper for creating a synchronous Unmarshaller from the given function.

Attributes

Source
Unmarshaller.scala

Attributes

Source
Unmarshaller.scala

Inherited methods

Attributes

Inherited from:
MultipartUnmarshallers
Source
MultipartUnmarshallers.scala
def multipartUnmarshaller[T <: Multipart, BP <: BodyPart, BPS <: Strict](mediaRange: MediaRange, defaultContentType: ContentType, createBodyPart: (BodyPartEntity, List[HttpHeader]) => BP, createStreamed: (Multipart, Source[BP, Any]) => T, createStrictBodyPart: (Strict, List[HttpHeader]) => BPS, createStrict: (Multipart, Seq[BPS]) => T)(implicit log: LoggingAdapter, parserSettings: ParserSettings): FromEntityUnmarshaller[T]

Attributes

Inherited from:
MultipartUnmarshallers
Source
MultipartUnmarshallers.scala

Implicits

Implicits

final implicit def EnhancedUnmarshaller[A, B](um: Unmarshaller[A, B]): EnhancedUnmarshaller[A, B]

Attributes

Source
Unmarshaller.scala
implicit def identityUnmarshaller[T]: Unmarshaller[T, T]

Attributes

Source
Unmarshaller.scala

Inherited implicits

implicit def CsvSeq[T](implicit unmarshaller: Unmarshaller[String, T]): Unmarshaller[String, Seq[T]]
implicit def eitherUnmarshaller[L, R](implicit ua: FromEntityUnmarshaller[L], rightTag: ClassTag[R], ub: FromEntityUnmarshaller[R], leftTag: ClassTag[L]): FromEntityUnmarshaller[Either[L, R]]

Enables using Either to encode the following unmarshalling logic: Attempt unmarshalling the entity as as R first (yielding R), and if it fails attempt unmarshalling as L (yielding Left).

Enables using Either to encode the following unmarshalling logic: Attempt unmarshalling the entity as as R first (yielding R), and if it fails attempt unmarshalling as L (yielding Left).

The either unmarshaller only works with strict entities, so make sure to wrap routes that want to use it with toStrictEntity. Otherwise, if a non-strict entity is provided, it will fail with an IllegalArgumentException.

Note that the Either's "R" type will be attempted first (as Left is often considered as the "failed case" in Either).

Attributes

Inherited from:
LowerPriorityGenericUnmarshallers
Source
GenericUnmarshallers.scala
implicit def liftToTargetOptionUnmarshaller[A, B](um: Unmarshaller[A, B]): Unmarshaller[A, Option[B]]

Attributes

Inherited from:
GenericUnmarshallers
Source
GenericUnmarshallers.scala
implicit def sourceOptionUnmarshaller[A, B](implicit um: Unmarshaller[A, B]): Unmarshaller[Option[A], B]
implicit def targetOptionUnmarshaller[A, B](implicit um: Unmarshaller[A, B]): Unmarshaller[A, Option[B]]

Attributes

Inherited from:
GenericUnmarshallers
Source
GenericUnmarshallers.scala