Is there an easy way to have request params names different than the field names in the class used as @ParameterObject?
The reason I want to use different name is that the request parameters are expected to contain an underscore and it's not something I would like to have in a field or method name, so I'm looking for solutions that don't require this.
Below an example of what I would like to achieve.
Parameter object:
public class SearchParams {
private String someParam;
private String someOtherParam;
}
In controller:
@GetMapping
public SomeResponse getFoos(@ParameterObject SearchParams params) {
return fooService.getFoos(params);
}
Request path:
GET /foos?some_param=abc&some_other_param=xyz