0

I have spring mvc controller that have a method. This method get some parameter. I configure swagger and using swagger for test a request.When I want to try request parameter it does not send.

@RequestMapping(value = "/listGrid", method = RequestMethod.GET)
public QueryResult<ActionViewModel> list(String searchFilter, String order,
                    int pageNumber, int pageSize) {
    return actionService.getAllGridList(new SearchOption(searchFilter, 
                order, pageNumber, pageSize));
} 

curl that generate for request by swagger is this

 curl -X GET --header 'Content-Type: application/json' --header 'Accept: */*' --header 'Authorization: Bearer 792a553e-b371-48a9-b031-12b634de4ce6' **-d '1'** 'http://localhost:8086/api/security/action/listGrid'
sn0wfall
  • 19
  • 4
ali akbar azizkhani
  • 2,213
  • 5
  • 31
  • 48

1 Answers1

3

Did you try it adding the requestParam annotation in each paramaters?

@RequestMapping(value = "/listGrid", method = RequestMethod.GET)
public QueryResult<ActionViewModel> list(
    @RequestParam String searchFilter,
    @RequestParam String order, 
    @RequestParam int pageNumber,
    @RequestParam int pageSize) {
    // body
}
Archie
  • 6,391
  • 4
  • 36
  • 44
duardito
  • 107
  • 2
  • 8