I am implementing a web service using spring boot 1.3.6. In my controller, I have a method like:
@RequestMapping(value = "/employees/{id}", method = RequestMethod.PUT)
createEmployee(@PathVariable String id,
@QueryParam(required = false, value = "department") Set<String> departments)
I want to collect the request parameters in a class like:
class EmployeeParams {
public String id;
public Set<String> departments;
}
I tried using:
@RequestMapping(value = "/employees/{id}", method = RequestMethod.PUT)
createEmployee(EmployeeParams param) { ... }
But it does not work. I get the id in above class but not departments. What is the proper way of collecting the request parameters in Spring requests?