I\'m trying to define an optional query parameter that will map to a Long, but will be null when it is not present in the URL:
Long
null
GET
In my case I use a String variable.
Example :
In my route :
GET /foo controller.Foo.index(id: String ?= "")
Then I convert in my code with a parser to Long --> Long.parseLong.
But I agree that the method of Hristo is the best.