my existing code is below:
@RequestMapping(value = "/{id}/{type}/{answer}", method = RequestMethod.GET)
@ResponseBody
public Results answer(@PathVariable("id") int questionId,
@PathVariable int type,
@PathVariable Boolean answer) {
//do something
}
I want to be able to add the ability to make a request with an arbitrary number of path variables, but keeping the same pattern as above (i.e. /id/type/answer/id/type/answer/id/type/answer/...etc.).
So ideally I want to be able to create an API call that can support both of the following URLs:
http://www.example.com/sendAnswer/id1/typeA/0
AND
http://www.example.com/sendAnswer/id1/typeA/0/id2/typeB/1/id3/typeA/0
Does anyone have any ideas?