EndpointErrorOutputVariantsOps

trait EndpointErrorOutputVariantsOps[A, I, E, O, -R]
class Object
trait Matchable
class Any
class Endpoint[A, I, E, O, R]
class PartialServerEndpoint[A, U, I, E, O, R, F]

Type members

Types

type EndpointType[_A, _I, _E, _O, -_R]

Value members

Abstract methods

Concrete methods

def errorOutEither[E2](o: EndpointOutput[E2]): EndpointType[A, I, Either[E, E2], O, R]

Adds a new error variant, where the current error output is represented as a Left, and the given one as a Right.

Adds a new error variant, where the current error output is represented as a Left, and the given one as a Right.

def errorOutVariant[E2 >: E](o: OneOfVariant[_ <: E2]): EndpointType[A, I, E2, O, R]

Adds a new error output variant. The new variant will be checked first during encoding/decoding, before the endpoint's current output.

Adds a new error output variant. The new variant will be checked first during encoding/decoding, before the endpoint's current output.

More specifically, the current error output is replaced with a Tapir.oneOf output, where:

  • the first output variant is the given o
  • the second output variant is the current errorOutput, wrapped with Tapir.oneOfDefaultVariant
Type Params
E2

A common supertype of the new variant and the current output E.

Value Params
o

The variant to add. Can be created given an output with one of the Tapir.oneOfVariant methods.

def errorOutVariantMap[E2](o: OneOfVariant[_ <: E2])(f: E => E2)(g: E2 => E): EndpointType[A, I, E2, O, R]

Adds a new error variant, where the current error output is mapped to conform to the common supertype E2 using the f and g functions.

Adds a new error variant, where the current error output is mapped to conform to the common supertype E2 using the f and g functions.

def errorOutVariants[E2 >: E](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*): EndpointType[A, I, E2, O, R]

Adds new error output variants. The new variants will be checked first during encoding/decoding, before the endpoint's current output.

Adds new error output variants. The new variants will be checked first during encoding/decoding, before the endpoint's current output.

More specifically, the current error output is replaced with a Tapir.oneOf output, where:

  • the initial output variants are the given first and other
  • the last output variant is the current errorOutput, wrapped with Tapir.oneOfDefaultVariant
Type Params
E2

A common supertype of the new variant and the current output E.

Value Params
first

The first variant to add. Can be created given an output with one of the Tapir.oneOfVariant methods.

other

Additional variants to add.

def errorOutVariantsMap[E2](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*)(f: E => E2)(g: E2 => E): EndpointType[A, I, E2, O, R]

Adds new error variants, where the current error output is mapped to conform to the common supertype E2 using the f and g functions.

Adds new error variants, where the current error output is mapped to conform to the common supertype E2 using the f and g functions.