I have a resource I want to filter by some search terms, among which there are some attributes which I'd like to send in the format
?attributeNames[0]=Foo&attributeValues[0]=Bar&attributeValues[0]=Baz
(or semantically equivalent - each name can map to one or more values)
What's the best way to represent this inside a Spring REST endpoint? I've tried with method parameters like
public void endpoint(@RequestParam(...)String[] names, @RequestParam(...)String[][] values) {
}
but this doesn't seem to work as expected (I can't see any way to specify the parameter names correctly). Is it possible to do this or is it just going to work out better if I use some other mechanism (serialize the parameters as JSON objects for example)?