PartialServerEndpoint

case
class PartialServerEndpoint[A, U, I, E, O, -R, F[_]](endpoint: Endpoint[A, I, E, O, R], securityLogic: MonadError[F] => A => F[Either[E, U]]) extends EndpointInputsOps[A, I, E, O, R] with EndpointOutputsOps[A, I, E, O, R] with EndpointErrorOutputVariantsOps[A, I, E, O, R] with EndpointInfoOps[R] with EndpointMetaOps

An endpoint with the security logic provided, and the main logic yet unspecified. See Endpoint.serverSecurityLogic.

The provided security part of the server logic transforms inputs of type A, either to an error of type E, or value of type U.

The part of the server logic which is not provided, will have to transform both U and the rest of the input I either into an error, or a value of type O.

Inputs/outputs can be added to partial endpoints as to regular endpoints. The shape of the error outputs can be adjusted in a limited way, by adding new error output variants, similar as if they were defined using Tapir.oneOf; the variants and the existing error outputs should usually have a common supertype (other than Any). Hence, it's possible to create a base, secured input, and then specialise it with inputs, outputs and logic as needed.

Type Params
A

"Auth": Security input parameter types, which the security logic accepts and returns a U or an error E.

E

Error output parameter types.

F

The effect type used in the provided partial server logic.

I

Input parameter types.

O

Output parameter types.

R

The capabilities that are required by this endpoint's inputs/outputs. Any, if no requirements.

U

"User": The type of the value returned by the security logic.

trait Serializable
trait Product
trait Equals
trait EndpointErrorOutputVariantsOps[A, I, E, O, R]
trait EndpointOutputsOps[A, I, E, O, R]
trait EndpointOutputsMacros[A, I, E, O, R]
trait EndpointInputsOps[A, I, E, O, R]
trait EndpointInputsMacros[A, I, E, O, R]
class Object
trait Matchable
class Any
PartialServerEndpoint[A, U, I, E, O, R, F]

Type members

Types

override
type EndpointType[_A, _I, _E, _O, -_R] = PartialServerEndpoint[_A, U, _I, _E, _O, _R, F]
override
type ThisType[-_R] = PartialServerEndpoint[A, U, I, E, O, _R, F]

Value members

Concrete methods

override
Definition Classes
override
Definition Classes
override
Definition Classes
override
Definition Classes
def serverLogic(f: U => I => F[Either[E, O]]): Full[A, U, I, E, O, R, F]
def serverLogicError(f: U => I => F[E]): Full[A, U, I, E, O, R, F]
def serverLogicPure(f: U => I => Either[E, O]): Full[A, U, I, E, O, R, F]
def serverLogicRecoverErrors(f: U => I => F[O])(implicit eIsThrowable: E <:< Throwable, eClassTag: ClassTag[E]): Full[A, U, I, E, O, R, F]
def serverLogicSuccess(f: U => I => F[O]): Full[A, U, I, E, O, R, F]

Inherited methods

def connect: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def delete: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
Inherited from
EndpointInfoOps
def description(d: String): ThisType[R]
Inherited from
EndpointInfoOps
def docsExtension[D : JsonCodec](key: String, value: D): ThisType[R]
Inherited from
EndpointInfoOps
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.

Inherited from
EndpointErrorOutputVariantsOps
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.

Inherited from
EndpointErrorOutputVariantsOps
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.

Inherited from
EndpointErrorOutputVariantsOps
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.

Inherited from
EndpointErrorOutputVariantsOps
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.

Inherited from
EndpointErrorOutputVariantsOps
def get: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def head: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def in[BS, J, IJ, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: Aux[I, J, IJ]): EndpointType[A, IJ, E, O, R & R2]
Inherited from
EndpointInputsOps
def in[J, IJ](i: EndpointInput[J])(implicit concat: Aux[I, J, IJ]): EndpointType[A, IJ, E, O, R]
Inherited from
EndpointInputsOps
Inherited from
EndpointInfoOps
def mapIn[II](f: I => II)(g: II => I): EndpointType[A, II, E, O, R]
Inherited from
EndpointInputsOps
def mapIn[II](m: Mapping[I, II]): EndpointType[A, II, E, O, R]
Inherited from
EndpointInputsOps
def mapInDecode[II](f: I => DecodeResult[II])(g: II => I): EndpointType[A, II, E, O, R]
Inherited from
EndpointInputsOps
inline
def mapInTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): EndpointType[A, CASE_CLASS, E, O, R]
Inherited from
EndpointInputsMacros
def mapOut[OO](f: O => OO)(g: OO => O): EndpointType[A, I, E, OO, R]
Inherited from
EndpointOutputsOps
def mapOut[OO](m: Mapping[O, OO]): EndpointType[A, I, E, OO, R]
Inherited from
EndpointOutputsOps
def mapOutDecode[OO](f: O => DecodeResult[OO])(g: OO => O): EndpointType[A, I, E, OO, R]
Inherited from
EndpointOutputsOps
inline
def mapOutTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): EndpointType[A, I, E, CASE_CLASS, R]
Inherited from
EndpointOutputsMacros
def method(m: Method): EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def name(n: String): ThisType[R]
Inherited from
EndpointInfoOps
def options: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def out[PIPE_REQ_RESP, P, OP, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: Aux[O, P, OP]): EndpointType[A, I, E, OP, R & R2 & WebSockets]
Inherited from
EndpointOutputsOps
def out[BS, P, OP, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: Aux[O, P, OP]): EndpointType[A, I, E, OP, R & R2]
Inherited from
EndpointOutputsOps
def out[P, OP](i: EndpointOutput[P])(implicit ts: Aux[O, P, OP]): EndpointType[A, I, E, OP, R]
Inherited from
EndpointOutputsOps
def patch: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def post: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def prependIn[BS, J, JI, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: Aux[J, I, JI]): EndpointType[A, JI, E, O, R & R2]
Inherited from
EndpointInputsOps
def prependIn[J, JI](i: EndpointInput[J])(implicit concat: Aux[J, I, JI]): EndpointType[A, JI, E, O, R]
Inherited from
EndpointInputsOps
def prependOut[PIPE_REQ_RESP, P, PO, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: Aux[P, O, PO]): EndpointType[A, I, E, PO, R & R2 & WebSockets]
Inherited from
EndpointOutputsOps
def prependOut[BS, P, PO, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: Aux[P, O, PO]): EndpointType[A, I, E, PO, R]
Inherited from
EndpointOutputsOps
def prependOut[P, PO](i: EndpointOutput[P])(implicit ts: Aux[P, O, PO]): EndpointType[A, I, E, PO, R]
Inherited from
EndpointOutputsOps
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def put: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps
def renderPathTemplate(renderPathParam: RenderPathParam, renderQueryParam: Option[RenderQueryParam], includeAuth: Boolean): String

Renders endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for

Renders endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for

endpoint.in("p1" / path[String] / query[String]("par2"))

returns /p1/{param1}?par2={par2}

Value Params
includeAuth

Should authentication inputs be included in the result.

Inherited from
EndpointMetaOps
def show: String

Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.)

Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.)

Inherited from
EndpointMetaOps
def showDetail: String

Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information.

Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information.

Inherited from
EndpointMetaOps
def showRaw: String

Equivalent to .toString, shows the whole case class structure.

Equivalent to .toString, shows the whole case class structure.

Inherited from
EndpointMetaOps
def summary(s: String): ThisType[R]
Inherited from
EndpointInfoOps
def tag(t: String): ThisType[R]
Inherited from
EndpointInfoOps
def tags(ts: List[String]): ThisType[R]
Inherited from
EndpointInfoOps
def trace: EndpointType[A, I, E, O, R]
Inherited from
EndpointInputsOps