Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1362

Akka http parameter optional dsl error

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 1362

Trending Articles