Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending multiple variants #3438

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

pramodShehan5
Copy link
Contributor

No description provided.

@pramodShehan5
Copy link
Contributor Author

pramodShehan5 commented Jan 3, 2024

@adamw There is no way to use multiple errorVariants using errorOutVariantPrepend.
So I just created new function for it

@@ -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 errorOutVariantPrepends[E2 >: E](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*): EndpointType[A, I, E2, O, R] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think errorOutVariantsPrepend would be more grammatically correct?

Copy link
Contributor Author

@pramodShehan5 pramodShehan5 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @adamw . I changed the function name :)

@adamw
Copy link
Member

adamw commented Jan 5, 2024

Thanks, I left one comment in code :)

@pramodShehan5 pramodShehan5 requested a review from adamw January 5, 2024 16:16
@pramodShehan5 pramodShehan5 marked this pull request as draft January 5, 2024 16:20
@pramodShehan5 pramodShehan5 marked this pull request as ready for review January 6, 2024 16:10
Appending multiple variants

Rename function name

Fix errorOutVariantsPrepend compliation error
@adamw adamw merged commit 5530002 into softwaremill:master Jan 8, 2024
23 checks passed
@adamw
Copy link
Member

adamw commented Jan 8, 2024

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants