These are my thoughts on using the (bleeding edge) query-params-new from 1.6.0-beta.1+canary.01f3f32c
.
The currently handled parameter types are strings (of course), arrays (with the arr[]=foo1&arr[]=foo2
syntax, which is not the nicest but closest zu the standard) and booleans. The absence of integer parameters means having to use parseInt()
in every method where the parameter is used. (Setting the parameter to a number value is no problem)
I think there are two ways to determine whether to cast or not while parsing parameters:
- Check if param contains only digits and just assume that it's meant to be a numeric parameter then. Since this may cause unforeseen behaviour we shouldn't do this
- Add a descriptior to the controllers
queryParams
to force a query parameters data type (this would also allow providing an array when the present url is arr=foo1
without the []
, but I'm not sure if this is a desirable thing)