Skip to content

Commit

Permalink
Appending multiple variants (#3438)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodShehan5 authored Jan 8, 2024
1 parent a9987bc commit 5530002
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/scala/sttp/tapir/Endpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ trait EndpointErrorOutputVariantsOps[A, I, E, O, -R] {
def errorOutVariantPrepend[E2 >: E](o: OneOfVariant[_ <: E2]): EndpointType[A, I, E2, O, R] =
withErrorOutputVariant(oneOf[E2](o, oneOfDefaultVariant(errorOutput)), identity)

/** Same as [[errorOutVariantPrepend]], but allows appending multiple variants in one go. */
def errorOutVariantsPrepend[E2 >: E](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*): EndpointType[A, I, E2, O, R] =
withErrorOutputVariant(oneOf[E2](oneOfDefaultVariant(errorOutput), first +: other: _*), identity)

/** Same as [[errorOutVariant]], but allows appending multiple variants in one go. */
def errorOutVariants[E2 >: E](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*)(implicit
ct: ClassTag[E],
Expand Down

0 comments on commit 5530002

Please sign in to comment.