Using Spring 4 to create REST controllers, I would like to return warnings in responses of my controllers if clients used unexpected query parameters.
There is a way to get all query parameters (http://stackoverflow.com/questions/7312436), but what I would like is for Spring to provide all query parameters that have not been been mapped to method params by Spring already.
Then I would decide how to treat them, e.g. ignore a some whitelisted query params that have meaning for the client or intermediates, return error when the old name of a parameter was used, return a warning in the response for all other query parameters such that human users can see if their assumption about the query param name was wrong.
So is there an easy way to get all query params from the request that have not been defined using @RequestParam()
?