diff --git a/core/src/main/scala/sttp/tapir/Endpoint.scala b/core/src/main/scala/sttp/tapir/Endpoint.scala index 825f34fdcf..89c1c74302 100644 --- a/core/src/main/scala/sttp/tapir/Endpoint.scala +++ b/core/src/main/scala/sttp/tapir/Endpoint.scala @@ -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],