How can I use Option type as path pram in playframework?

I want to use an Option type as path param in routes file to call an action method in controller-

in routes file

GET /test/:x/:y       controllers.TestController.test(x:Int, y:Option[Int])

in controller -

def test(x:Int,y:Option[Int])=Action{. . . .}

but my compiler says me -

 implement an implicit PathBindable for this type..

How can I do this for Option Type ?

From the manual I’m driven to think that optional parameters are encoded as query-params, whereas different alternative paths should be defined using separate routes.

1 Like

thank you sir.