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

test(testing): add test to detect duplicate endpoint names #3908

Merged
merged 9 commits into from
Jul 19, 2024
Prev Previous commit
Next Next commit
add endpoint name helpers (prefix/suffix)
  • Loading branch information
ThijsBroersen committed Jul 17, 2024
commit 15bef8333d06f3109ebbbd77cf5f632950acffbd
3 changes: 3 additions & 0 deletions core/src/main/scala/sttp/tapir/Endpoint.scala
Original file line number Diff line number Diff line change
@@ -314,6 +314,9 @@ trait EndpointInfoOps[-R] {
private[tapir] def withInfo(info: EndpointInfo): ThisType[R]

def name(n: String): ThisType[R] = withInfo(info.name(n))
def prefixName(n: String): ThisType[R] = withInfo(info.copy(name = Some(n + info.name.getOrElse(""))))
ThijsBroersen marked this conversation as resolved.
Show resolved Hide resolved
def suffixName(n: String): ThisType[R] = withInfo(info.copy(name = info.name.map(_ + n)))

def summary(s: String): ThisType[R] = withInfo(info.summary(s))
def description(d: String): ThisType[R] = withInfo(info.description(d))
def deprecated(): ThisType[R] = withInfo(info.deprecated(true))
Loading