I have a route like /test?format=xx
and parameter format is optional
in scala, I wrote:
path("test") {
parameters("format".optional) {format =>
get {
complete(...)
}
}
But I got the following error:
value optional is not a member of String
parameters(“format”.optional) {format =>
I already imported
import akka.http.scaladsl.server.{Directive0, Directives}
and
import Directives._
what am I missing?
Thanks.
6 posts - 2 participants