t

sttp.tapir

EndpointErrorOutputVariantsOps

trait EndpointErrorOutputVariantsOps[A, I, E, O, -R] extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EndpointErrorOutputVariantsOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract type EndpointType[_A, _I, _E, _O, -_R]

Abstract Value Members

  1. abstract def errorOutput: EndpointOutput[E]

Concrete 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(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. 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.

  9. 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.

  10. 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.

  11. 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.

  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def mapErrorOut[EE](f: (E) => EE)(g: (EE) => E): EndpointType[A, I, EE, O, R]
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped