Play 2.0: additional list in request

I am trying to define a route with an optional list as a query parameter

GET /places controllers.Application.query(filter: Option[Seq[Int]]) 

but getting this error

 conf/routes - PlayException: Compilation error [`)' expected but `]' found] 

I know Play 2 handle Option , and I want to pass Seq to my custom QueryStringBindable , how to do this?

+7
source share
1 answer

It seems that Parallels Routing from Play 2.0.2 does not support nesting type options. I found a workaround, I defined an alias for Seq[Int] :

 type IntSeq = Seq[Int] 

and used it instead of the original type:

 GET /places controllers.Application.query(filter: Option[IntSeq]) 

Now it works as expected.

+7
source

All Articles