trait EndpointErrorOutputVariantsOps[A, I, E, O, -R] extends AnyRef
- Alphabetic
- By Inheritance
- EndpointErrorOutputVariantsOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract type EndpointType[_A, _I, _E, _O, -_R]
Abstract Value Members
- abstract def errorOutput: EndpointOutput[E]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- 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 aRight
. - def errorOutVariant[E2 >: E](o: OneOfVariant[_ <: E2])(implicit ct: ClassTag[E], eEqualToErasure: ErasureSameAsType[E]): EndpointType[A, I, E2, O, 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 theE
type is different fromE
, 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.
- 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.
- the first output variant is the current output:
- def errorOutVariantPrepend[E2 >: E](o: OneOfVariant[_ <: E2]): EndpointType[A, I, E2, O, 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.
- 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.
- the first output variant is the given
- 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.
- 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
.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapErrorOut[EE](f: (E) => EE)(g: (EE) => E): EndpointType[A, I, EE, O, R]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
- Deprecated