Michael Böckling
Michael Böckling

Reputation: 7862

Swagger turns query param into post body

I have a POST operation in a SpringBoot @RestController that takes a query param and a request body:

@RequestMapping(path = "/benchmark", method = POST)
public String startBenchmark(@QueryParam("numMessages") int numMessages, @RequestBody String body) {

Swagger UI will render 'numMessages' as parameter type "body". Is there a way to correct this?

Upvotes: 1

Views: 2365

Answers (1)

pvpkiran
pvpkiran

Reputation: 27018

Use Spring's @RequestParam instead of Jersey @QueryParam

Upvotes: 5

Related Questions