Single

sttp.tapir.EndpointIO.Single
sealed trait Single[I] extends EndpointIO[I], Single[I], Single[I]

Attributes

Graph
Supertypes
trait Single[I]
trait Single[I]
trait EndpointIO[I]
trait EndpointOutput[I]
trait EndpointInput[I]
trait EndpointTransput[I]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Basic[I]
trait Atom[I]
class Body[R, T]
class Empty[T]
class FixedHeader[T]
class Header[T]
class Headers[T]
class StreamBodyWrapper[BS, T]
class OneOfBody[O, T]
class MappedPair[T, U, TU, V]
Show all

Members list

Value members

Inherited methods

def /[U, TU](other: EndpointInput[U])(implicit concat: Aux[I, U, TU]): EndpointInput[TU]

Attributes

Inherited from:
EndpointInput
def and[J, IJ](other: EndpointOutput[J])(implicit concat: Aux[I, J, IJ]): EndpointOutput[IJ]

Attributes

Inherited from:
EndpointOutput
def and[U, TU](other: EndpointInput[U])(implicit concat: Aux[I, U, TU]): EndpointInput[TU]

Attributes

Inherited from:
EndpointInput
def and[J, IJ](other: EndpointIO[J])(implicit concat: Aux[I, J, IJ]): EndpointIO[IJ]

Attributes

Inherited from:
EndpointIO
def map[U](f: I => U)(g: U => I): ThisType[U]

Attributes

Inherited from:
EndpointTransput
def mapDecode[U](f: I => DecodeResult[U])(g: U => I): ThisType[U]

Attributes

Inherited from:
EndpointTransput
inline def mapTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): ThisType[CASE_CLASS]

Attributes

Inherited from:
EndpointTransputMacros
def mapValidate[U](v: Validator[I])(f: I => U)(g: U => I): ThisType[U]

Adds the given validator, and maps to the given higher-level type U.

Adds the given validator, and maps to the given higher-level type U.

Unlike a .validate(v).map(f)(g) invocation, during decoding the validator is run before applying the f function. If there are validation errors, decoding fails. However, the validator is then invoked again on the fully decoded value.

This is useful to create inputs/outputs for types, which are unrepresentable unless the validator's condition is met, e.g. due to preconditions in the constructor.

Attributes

See also
Inherited from:
EndpointTransput
def validate(v: Validator[I]): ThisType[I]

Adds a validator.

Adds a validator.

Note that validation is run on a fully decoded value. That is, during decoding, first the decoding functions are run, followed by validations. Hence any functions provided in subsequent .map s or .mapDecode s will be invoked before validation.

Attributes

See also
Inherited from:
EndpointTransput

Inherited and Abstract methods

def map[U](mapping: Mapping[I, U]): ThisType[U]

Attributes

Inherited from:
EndpointTransput
def show: String

Attributes

Inherited from:
EndpointTransput