Hit this while logging validator descriptions for an enum-backed query parameter. The string Validator.show produces is missing the closing ).
//> using scala 3.8.3
//> using dep com.softwaremill.sttp.tapir::tapir-core::1.11.25
import sttp.tapir.Validator
@main def run(): Unit =
val v = Validator.enumeration(List("A", "B", "C"))
println(v.show)
Output:
Expected: Some(in(A,B,C)).
Source line:
|
case Enumeration(possibleValues, _, _) => Some(s"in(${possibleValues.mkString(",")}") |
case Enumeration(possibleValues, _, _) => Some(s"in(${possibleValues.mkString(",")}")
The interpolation closes the inner mkString(",") but then the string ends, so the ) for in( never makes it out. The neighbouring all(...) and any(...) cases on lines 317 and 323 do close their parens correctly, so this looks like a one-character typo:
case Enumeration(possibleValues, _, _) => Some(s"in(${possibleValues.mkString(",")})")
Happy to PR.
Hit this while logging validator descriptions for an enum-backed query parameter. The string
Validator.showproduces is missing the closing).Output:
Expected:
Some(in(A,B,C)).Source line:
tapir/core/src/main/scala/sttp/tapir/Validator.scala
Line 311 in 88d662d
The interpolation closes the inner
mkString(",")but then the string ends, so the)forin(never makes it out. The neighbouringall(...)andany(...)cases on lines 317 and 323 do close their parens correctly, so this looks like a one-character typo:Happy to PR.