Hi there!
Currently, I'm using Play 2.5.4 and I'm studying to upgrade both for the newest version. However, I have a doubt:
We are using Play to provide a REST API that manages some resources. Example: we have 2 resources, Car and Activity, so, there is one GET call per resource to retrieve all elements paged. Each these calls got required attributes like start date, end date, page and per page. Also, each call has specific optional attributes like car model, car color for cars and activity type for activities. Example: (* means required)
GET /cars attributes:
*DateTime startDate
*DateTime endDate
*Integer page
*Interger perPage
String model
String color
GET /activities:
*DateTime startDate
*DateTime endDate
*Integer page
*Interger perPage
AcitivityType(Enum) type
Currently, to validate the required attributes and its type, we are using the bindFromRequest() to bound the query string parameters in a Form class. But, on Play 2.6, I've read the migration guide and noticed that with Play 2.6, query string parameters will not be bound to a form instance anymore when using
bindFromRequest(). https://www.playframework.com/documentation/2.6.x/Migration26#Form-changes
What is the best way to handle query string parameters and validate them?