Packages

c

sttp.tapir.server

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 with Product with Serializable

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.

A

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

U

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

I

Input parameter types.

E

Error output parameter types.

O

Output parameter types.

R

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

F

The effect type used in the provided partial server logic.

Self Type
PartialServerEndpoint[A, U, I, E, O, R, F]
Linear Supertypes
Serializable, Serializable, Product, Equals, EndpointMetaOps, EndpointInfoOps[R], EndpointErrorOutputVariantsOps[A, I, E, O, R], EndpointOutputsOps[A, I, E, O, R], EndpointOutputsMacros[A, I, E, O, R], EndpointInputsOps[A, I, E, O, R], EndpointInputsMacros[A, I, E, O, R], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PartialServerEndpoint
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. EndpointMetaOps
  7. EndpointInfoOps
  8. EndpointErrorOutputVariantsOps
  9. EndpointOutputsOps
  10. EndpointOutputsMacros
  11. EndpointInputsOps
  12. EndpointInputsMacros
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PartialServerEndpoint(endpoint: Endpoint[A, I, E, O, R], securityLogic: (MonadError[F]) ⇒ (A) ⇒ F[Either[E, U]])

Type Members

  1. type EndpointType[_A, _I, _E, _O, -_R] = PartialServerEndpoint[_A, U, _I, _E, _O, _R, F]
  2. type ThisType[-_R] = PartialServerEndpoint[A, U, I, E, O, _R, F]
    Definition Classes
    PartialServerEndpointEndpointInfoOps

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  6. def connect: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  7. def delete: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  8. def deprecated(): ThisType[R]
    Definition Classes
    EndpointInfoOps
  9. def description(d: String): ThisType[R]
    Definition Classes
    EndpointInfoOps
  10. def docsExtension[D](key: String, value: D)(implicit arg0: JsonCodec[D]): ThisType[R]
    Definition Classes
    EndpointInfoOps
  11. val endpoint: Endpoint[A, I, E, O, R]
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. 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.

    Definition Classes
    EndpointErrorOutputVariantsOps
  14. def errorOutVariant[E2 >: E](o: OneOfVariant[_ <: E2])(implicit ct: ClassTag[E], eEqualToErasure: ErasureSameAsType[E]): EndpointType[A, I, E2, O, R]

    Appends a new error output variant.

    Appends a new error output variant.

    A variant for the current endpoint output will be created using the given Tapir.oneOfVariant. This is needed to capture the logic which allows deciding if a run-time value is applicable to a variant. 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 checked after the current variant.

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

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

    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.

    E2

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

    o

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

    Definition Classes
    EndpointErrorOutputVariantsOps
  15. def errorOutVariants[E2 >: E](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*)(implicit ct: ClassTag[E], eEqualToErasure: ErasureSameAsType[E]): EndpointType[A, I, E2, O, R]

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

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

    Definition Classes
    EndpointErrorOutputVariantsOps
  16. def errorOutVariantsFromCurrent[E2 >: E](variants: (EndpointOutput[E]) ⇒ List[OneOfVariant[_ <: E2]]): EndpointType[A, I, E2, O, R]

    Replace the error output with a Tapir.oneOf output, using the variants returned by 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.

    E2

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

    Definition Classes
    EndpointErrorOutputVariantsOps
  17. def errorOutput: EndpointOutput[E]
  18. def get: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def head: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  21. def in[BS, J, IJ, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: typelevel.ParamConcat.Aux[I, J, IJ]): EndpointType[A, IJ, E, O, R with R2]
    Definition Classes
    EndpointInputsOps
  22. def in[J, IJ](i: EndpointInput[J])(implicit concat: typelevel.ParamConcat.Aux[I, J, IJ]): EndpointType[A, IJ, E, O, R]
    Definition Classes
    EndpointInputsOps
  23. def info: EndpointInfo
  24. def info(i: EndpointInfo): ThisType[R]
    Definition Classes
    EndpointInfoOps
  25. def input: EndpointInput[I]
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def mapErrorOut[EE](f: (E) ⇒ EE)(g: (EE) ⇒ E): EndpointType[A, I, EE, O, R]
  28. def mapIn[II](f: (I) ⇒ II)(g: (II) ⇒ I): EndpointType[A, II, E, O, R]
    Definition Classes
    EndpointInputsOps
  29. def mapIn[II](m: Mapping[I, II]): EndpointType[A, II, E, O, R]
    Definition Classes
    EndpointInputsOps
  30. def mapInDecode[II](f: (I) ⇒ DecodeResult[II])(g: (II) ⇒ I): EndpointType[A, II, E, O, R]
    Definition Classes
    EndpointInputsOps
  31. macro def mapInTo[CASE_CLASS]: EndpointType[A, CASE_CLASS, E, O, R]
    Definition Classes
    EndpointInputsMacros
  32. def mapOut[OO](f: (O) ⇒ OO)(g: (OO) ⇒ O): EndpointType[A, I, E, OO, R]
    Definition Classes
    EndpointOutputsOps
  33. def mapOut[OO](m: Mapping[O, OO]): EndpointType[A, I, E, OO, R]
    Definition Classes
    EndpointOutputsOps
  34. def mapOutDecode[OO](f: (O) ⇒ DecodeResult[OO])(g: (OO) ⇒ O): EndpointType[A, I, E, OO, R]
    Definition Classes
    EndpointOutputsOps
  35. macro def mapOutTo[CASE_CLASS]: EndpointType[A, I, E, CASE_CLASS, R]
    Definition Classes
    EndpointOutputsMacros
  36. def method: Option[Method]

    The method defined in a fixed method input in this endpoint, if any (using e.g.

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

    Definition Classes
    EndpointMetaOps
  37. def method(m: Method): EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  38. def name(n: String): ThisType[R]
    Definition Classes
    EndpointInfoOps
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. def options: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  43. def out[PIPE_REQ_RESP, P, OP, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: typelevel.ParamConcat.Aux[O, P, OP]): EndpointType[A, I, E, OP, R with R2 with WebSockets]
    Definition Classes
    EndpointOutputsOps
  44. def out[BS, P, OP, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: typelevel.ParamConcat.Aux[O, P, OP]): EndpointType[A, I, E, OP, R with R2]
    Definition Classes
    EndpointOutputsOps
  45. def out[P, OP](i: EndpointOutput[P])(implicit ts: typelevel.ParamConcat.Aux[O, P, OP]): EndpointType[A, I, E, OP, R]
    Definition Classes
    EndpointOutputsOps
  46. def output: EndpointOutput[O]
  47. def patch: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  48. def post: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  49. def prependIn[BS, J, JI, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: typelevel.ParamConcat.Aux[J, I, JI]): EndpointType[A, JI, E, O, R with R2]
    Definition Classes
    EndpointInputsOps
  50. def prependIn[J, JI](i: EndpointInput[J])(implicit concat: typelevel.ParamConcat.Aux[J, I, JI]): EndpointType[A, JI, E, O, R]
    Definition Classes
    EndpointInputsOps
  51. def prependOut[PIPE_REQ_RESP, P, PO, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: typelevel.ParamConcat.Aux[P, O, PO]): EndpointType[A, I, E, PO, R with R2 with WebSockets]
    Definition Classes
    EndpointOutputsOps
  52. def prependOut[BS, P, PO, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: typelevel.ParamConcat.Aux[P, O, PO]): EndpointType[A, I, E, PO, R]
    Definition Classes
    EndpointOutputsOps
  53. def prependOut[P, PO](i: EndpointOutput[P])(implicit ts: typelevel.ParamConcat.Aux[P, O, PO]): EndpointType[A, I, E, PO, R]
    Definition Classes
    EndpointOutputsOps
  54. def put: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  55. def renderPathTemplate(renderPathParam: RenderPathParam = RenderPathTemplate.Defaults.path, renderQueryParam: Option[RenderQueryParam] = ..., includeAuth: Boolean = true): String

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

    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}

    includeAuth

    Should authentication inputs be included in the result.

    Definition Classes
    EndpointMetaOps
  56. def securityInput: EndpointInput[A]
    Definition Classes
    PartialServerEndpointEndpointMetaOps
  57. val securityLogic: (MonadError[F]) ⇒ (A) ⇒ F[Either[E, U]]
  58. def serverLogic(f: (U) ⇒ (I) ⇒ F[Either[E, O]]): Full[A, U, I, E, O, R, F]
  59. def serverLogicError(f: (U) ⇒ (I) ⇒ F[E]): Full[A, U, I, E, O, R, F]
  60. def serverLogicPure(f: (U) ⇒ (I) ⇒ Either[E, O]): Full[A, U, I, E, O, R, F]
  61. def serverLogicRecoverErrors(f: (U) ⇒ (I) ⇒ F[O])(implicit eIsThrowable: <:<[E, Throwable], eClassTag: ClassTag[E]): Full[A, U, I, E, O, R, F]
  62. def serverLogicSuccess(f: (U) ⇒ (I) ⇒ F[O]): Full[A, U, I, E, O, R, F]
  63. 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.)

    Definition Classes
    EndpointMetaOps
  64. 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.

    Definition Classes
    EndpointMetaOps
  65. def showRaw: String

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

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

    Definition Classes
    EndpointMetaOps
  66. def showType: String
    Attributes
    protected
    Definition Classes
    PartialServerEndpointEndpointMetaOps
  67. def summary(s: String): ThisType[R]
    Definition Classes
    EndpointInfoOps
  68. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  69. def tag(t: String): ThisType[R]
    Definition Classes
    EndpointInfoOps
  70. def tags(ts: List[String]): ThisType[R]
    Definition Classes
    EndpointInfoOps
  71. def trace: EndpointType[A, I, E, O, R]
    Definition Classes
    EndpointInputsOps
  72. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  74. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated
  2. def httpMethod: Option[Method]
    Definition Classes
    EndpointMetaOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.0) Use method

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from EndpointMetaOps

Inherited from EndpointInfoOps[R]

Inherited from EndpointErrorOutputVariantsOps[A, I, E, O, R]

Inherited from EndpointOutputsOps[A, I, E, O, R]

Inherited from EndpointOutputsMacros[A, I, E, O, R]

Inherited from EndpointInputsOps[A, I, E, O, R]

Inherited from EndpointInputsMacros[A, I, E, O, R]

Inherited from AnyRef

Inherited from Any

Ungrouped