PartialServerEndpointWithSecurityOutputSync

sttp.tapir.server.PartialServerEndpointWithSecurityOutputSync
case class PartialServerEndpointWithSecurityOutputSync[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, -R](securityOutput: EndpointOutput[SECURITY_OUTPUT], endpoint: Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], securityLogic: SECURITY_INPUT => Either[ERROR_OUTPUT, (SECURITY_OUTPUT, PRINCIPAL)]) extends EndpointInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointErrorOutputVariantsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], EndpointInfoOps[R], EndpointMetaOps

Direct-style variant of PartialServerEndpointWithSecurityOutput, using the Identity "effect".

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait EndpointInfoOps[R]
trait EndpointErrorOutputVariantsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointOutputsMacros[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
trait EndpointInputsMacros[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
class Object
trait Matchable
class Any
Show all
Self type
PartialServerEndpointWithSecurityOutputSync[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, R]

Members list

Type members

Types

override type EndpointType[_A, _I, _E, _O, -_R] = PartialServerEndpointWithSecurityOutputSync[_A, PRINCIPAL, _I, _E, SECURITY_OUTPUT, _O, _R]
override type ThisType[-_R] = PartialServerEndpointWithSecurityOutputSync[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, SECURITY_OUTPUT, OUTPUT, _R]

Value members

Concrete methods

override def errorOutput: EndpointOutput[ERROR_OUTPUT]

Attributes

Definition Classes
def handle(f: PRINCIPAL => INPUT => Either[ERROR_OUTPUT, OUTPUT]): Full[SECURITY_INPUT, (SECURITY_OUTPUT, PRINCIPAL), INPUT, ERROR_OUTPUT, (SECURITY_OUTPUT, OUTPUT), R, Identity]
def handleError(f: PRINCIPAL => INPUT => ERROR_OUTPUT): Full[SECURITY_INPUT, (SECURITY_OUTPUT, PRINCIPAL), INPUT, ERROR_OUTPUT, (SECURITY_OUTPUT, OUTPUT), R, Identity]
def handleOption(f: PRINCIPAL => INPUT => Option[OUTPUT])(implicit eIsUnit: ERROR_OUTPUT =:= Unit): Full[SECURITY_INPUT, (SECURITY_OUTPUT, PRINCIPAL), INPUT, Unit, (SECURITY_OUTPUT, OUTPUT), R, Identity]
def handleRecoverErrors(f: PRINCIPAL => INPUT => OUTPUT)(implicit eIsThrowable: ERROR_OUTPUT <:< Throwable, eClassTag: ClassTag[ERROR_OUTPUT]): Full[SECURITY_INPUT, (SECURITY_OUTPUT, PRINCIPAL), INPUT, ERROR_OUTPUT, (SECURITY_OUTPUT, OUTPUT), R, Identity]
def handleSuccess(f: PRINCIPAL => INPUT => OUTPUT): Full[SECURITY_INPUT, (SECURITY_OUTPUT, PRINCIPAL), INPUT, ERROR_OUTPUT, (SECURITY_OUTPUT, OUTPUT), R, Identity]
override def info: EndpointInfo

Attributes

Definition Classes
override def input: EndpointInput[INPUT]

Attributes

Definition Classes
override def output: EndpointOutput[OUTPUT]

Attributes

Definition Classes
override def securityInput: EndpointInput[SECURITY_INPUT]

Attributes

Definition Classes

Inherited methods

def attribute[T](k: AttributeKey[T], v: T): ThisType[R]

Attributes

Inherited from:
EndpointInfoOps
def attribute[T](k: AttributeKey[T]): Option[T]

Attributes

Inherited from:
EndpointInfoOps
def connect: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def delete: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def deprecated(): ThisType[R]

Attributes

Inherited from:
EndpointInfoOps
def description(d: String): ThisType[R]

Attributes

Inherited from:
EndpointInfoOps
def errorOutEither[E2](o: EndpointOutput[E2]): EndpointType[SECURITY_INPUT, INPUT, Either[ERROR_OUTPUT, E2], OUTPUT, 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.

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def errorOutVariant[E2 >: ERROR_OUTPUT](o: OneOfVariant[_ <: E2])(implicit ct: ClassTag[ERROR_OUTPUT], eEqualToErasure: ErasureSameAsType[ERROR_OUTPUT]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]

Replaces the current error output with a Tapir.oneOf output, where:

Replaces the current error output with a Tapir.oneOf output, where:

  • the first output variant is the current output: oneOfVariant(errorOutput)
  • the second output variant is the given o

The variant for the current endpoint output will be created using Tapir.oneOfVariant. Hence, the current output will be used if the run-time class of the output matches E. If the erasure of the E type is different from E, there will be a compile-time failure, as no such run-time check is possible. In this case, use errorOutVariantsFromCurrent and create a variant using one of the other variant factory methods (e.g. Tapir.oneOfVariantValueMatcher).

During encoding/decoding, the new o variant will be considered after the current variant.

Usage example:

 sealed trait Parent
 case class Child1(v: String) extends Parent
 case class Child2(v: String) extends Parent

 val e: PublicEndpoint[Unit, Parent, Unit, Any] = endpoint
   .errorOut(stringBody.mapTo[Child1])
   .errorOutVariant[Parent](oneOfVariant(stringBody.mapTo[Child2]))

Adding error output variants is useful when extending the error outputs in a PartialServerEndpoint, created using EndpointServerLogicOps.serverSecurityLogic.

Type parameters

E2

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

Value parameters

o

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

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def errorOutVariantPrepend[E2 >: ERROR_OUTPUT](o: OneOfVariant[_ <: E2]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]

Replaces the current error output with a Tapir.oneOf output, where:

Replaces the current error output with a Tapir.oneOf output, where:

  • the first output variant is the given o
  • the second, default output variant is the current output: oneOfDefaultVariant(errorOutput)

Useful for adding specific error variants, while the more general ones are already covered by the existing error output.

During encoding/decoding, the new o variant will be considered before the current variant.

Adding error output variants is useful when extending the error outputs in a PartialServerEndpoint, created using EndpointServerLogicOps.serverSecurityLogic.

Type parameters

E2

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

Value parameters

o

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

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def errorOutVariants[E2 >: ERROR_OUTPUT](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*)(implicit ct: ClassTag[ERROR_OUTPUT], eEqualToErasure: ErasureSameAsType[ERROR_OUTPUT]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]

Same as errorOutVariant, but allows appending multiple variants in one go.

Same as errorOutVariant, but allows appending multiple variants in one go.

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def errorOutVariantsFromCurrent[E2 >: ERROR_OUTPUT](variants: (EndpointOutput[ERROR_OUTPUT]) => List[OneOfVariant[_ <: E2]]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]

Replace the error output with a Tapir.oneOf output, using the variants returned by variants. The current output should be included in one of the returned variants.

Replace the error output with a Tapir.oneOf output, using the variants returned by variants. The current output should be included in one of the returned variants.

Allows creating the variant list in a custom order, placing the current variant in an arbitrary position, and using default variants if necessary.

Adding error output variants is useful when extending the error outputs in a PartialServerEndpoint, created using EndpointServerLogicOps.serverSecurityLogic.

Type parameters

E2

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

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def errorOutVariantsPrepend[E2 >: ERROR_OUTPUT](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]

Same as errorOutVariantPrepend, but allows appending multiple variants in one go.

Same as errorOutVariantPrepend, but allows appending multiple variants in one go.

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def get: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def head: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def in[BS, J, IJ, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: Aux[INPUT, J, IJ]): EndpointType[SECURITY_INPUT, IJ, ERROR_OUTPUT, OUTPUT, R & R2]

Attributes

Inherited from:
EndpointInputsOps
def in[J, IJ](i: EndpointInput[J])(implicit concat: Aux[INPUT, J, IJ]): EndpointType[SECURITY_INPUT, IJ, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def info(i: EndpointInfo): ThisType[R]

Attributes

Inherited from:
EndpointInfoOps
def mapErrorOut[EE](f: ERROR_OUTPUT => EE)(g: EE => ERROR_OUTPUT): EndpointType[SECURITY_INPUT, INPUT, EE, OUTPUT, R]

Attributes

Inherited from:
EndpointErrorOutputVariantsOps
def mapIn[II](f: INPUT => II)(g: II => INPUT): EndpointType[SECURITY_INPUT, II, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def mapIn[II](m: Mapping[INPUT, II]): EndpointType[SECURITY_INPUT, II, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def mapInDecode[II](f: INPUT => DecodeResult[II])(g: II => INPUT): EndpointType[SECURITY_INPUT, II, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
inline def mapInTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): EndpointType[SECURITY_INPUT, CASE_CLASS, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsMacros
def mapOut[OO](f: OUTPUT => OO)(g: OO => OUTPUT): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OO, R]

Attributes

Inherited from:
EndpointOutputsOps
def mapOut[OO](m: Mapping[OUTPUT, OO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OO, R]

Attributes

Inherited from:
EndpointOutputsOps
def mapOutDecode[OO](f: OUTPUT => DecodeResult[OO])(g: OO => OUTPUT): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OO, R]

Attributes

Inherited from:
EndpointOutputsOps
inline def mapOutTo[CASE_CLASS <: Product](using mc: ProductOf[CASE_CLASS]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, CASE_CLASS, R]

Attributes

Inherited from:
EndpointOutputsMacros
def method(m: Method): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def name(n: String): ThisType[R]

Attributes

Inherited from:
EndpointInfoOps
def options: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def out[PIPE_REQ_RESP, P, OP, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: Aux[OUTPUT, P, OP]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OP, R & R2 & WebSockets]

Attributes

Inherited from:
EndpointOutputsOps
def out[BS, P, OP, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: Aux[OUTPUT, P, OP]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OP, R & R2]

Attributes

Inherited from:
EndpointOutputsOps
def out[P, OP](i: EndpointOutput[P])(implicit ts: Aux[OUTPUT, P, OP]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OP, R]

Attributes

Inherited from:
EndpointOutputsOps
def patch: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def post: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def prependIn[BS, J, JI, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: Aux[J, INPUT, JI]): EndpointType[SECURITY_INPUT, JI, ERROR_OUTPUT, OUTPUT, R & R2]

Attributes

Inherited from:
EndpointInputsOps
def prependIn[J, JI](i: EndpointInput[J])(implicit concat: Aux[J, INPUT, JI]): EndpointType[SECURITY_INPUT, JI, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def prependOut[PIPE_REQ_RESP, P, PO, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: Aux[P, OUTPUT, PO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, PO, R & R2 & WebSockets]

Attributes

Inherited from:
EndpointOutputsOps
def prependOut[BS, P, PO, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: Aux[P, OUTPUT, PO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, PO, R & R2]

Attributes

Inherited from:
EndpointOutputsOps
def prependOut[P, PO](i: EndpointOutput[P])(implicit ts: Aux[P, OUTPUT, PO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, PO, R]

Attributes

Inherited from:
EndpointOutputsOps
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def put: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def showPathTemplate(showPathParam: (Int, PathCapture[_]) => String, showQueryParam: Option[(Int, Query[_]) => String], includeAuth: Boolean, showNoPathAs: String, showPathsAs: Option[String], showQueryParamsAs: Option[String]): String

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

Shows 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 parameters

includeAuth

Should authentication inputs be included in the result.

showNoPathAs

How to show the path if the endpoint does not define any path inputs.

showPathsAs

How to show Tapir.paths inputs (if at all), which capture multiple paths segments

showQueryParamsAs

How to show Tapir.queryParams inputs (if at all), which capture multiple query parameters

Attributes

Inherited from:
EndpointMetaOps
def showRaw: String

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

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

Attributes

Inherited from:
EndpointMetaOps
def summary(s: String): ThisType[R]

Attributes

Inherited from:
EndpointInfoOps
def tag(t: String): ThisType[R]

Append t to the existing tags.

Append t to the existing tags.

Attributes

Inherited from:
EndpointInfoOps
def tags(ts: List[String]): ThisType[R]

Append ts to the existing tags.

Append ts to the existing tags.

Attributes

Inherited from:
EndpointInfoOps
def trace: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]

Attributes

Inherited from:
EndpointInputsOps
def withTag(t: String): ThisType[R]

Overwrite the existing tags with a single tag t.

Overwrite the existing tags with a single tag t.

Attributes

Inherited from:
EndpointInfoOps
def withTags(ts: List[String]): ThisType[R]

Overwrite the existing tags with ts.

Overwrite the existing tags with ts.

Attributes

Inherited from:
EndpointInfoOps

Remove all tags from this endpoint.

Remove all tags from this endpoint.

Attributes

Inherited from:
EndpointInfoOps

Inherited fields

lazy val method: Option[Method]

The method defined in a fixed method input in this endpoint, if any (using e.g. EndpointInputsOps.get or EndpointInputsOps.post).

The method defined in a fixed method input in this endpoint, if any (using e.g. EndpointInputsOps.get or EndpointInputsOps.post).

Attributes

Inherited from:
EndpointMetaOps
lazy val show: String

Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.). E.g.: POST /books /add {header Authorization} {body as application/json (UTF-8)} -> {body as text/plain (UTF-8)}/-

Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.). E.g.: POST /books /add {header Authorization} {body as application/json (UTF-8)} -> {body as text/plain (UTF-8)}/-

Attributes

Inherited from:
EndpointMetaOps
lazy val showDetail: String

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

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

Endpoint(securityin: -, in: /books POST /add {body as application/json (UTF-8)} {header Authorization}, errout: {body as text/plain (UTF-8)}, out: -)

Attributes

Inherited from:
EndpointMetaOps
lazy val showShort: String

Shortened information about the endpoint. If the endpoint is named, returns the name, e.g. [my endpoint]. Otherwise, returns the string representation of the method (if any) and path, e.g. POST /books/add

Shortened information about the endpoint. If the endpoint is named, returns the name, e.g. [my endpoint]. Otherwise, returns the string representation of the method (if any) and path, e.g. POST /books/add

Attributes

Inherited from:
EndpointMetaOps