Closed wltj920 closed 4 years ago
Changing the code as below should help
@PostMapping("/phone-login")
@Operation(summary = "Login by phone", description = "Use sms system to login system")
public Object phoneLogin(
HttpServletRequest request,
@Parameter(name = "userPhone", description = "Phone number", required = true, in = ParameterIn.QUERY, example = "18900001234") String userPhone,
@Parameter(name = "phoneCode", description = "The code in sms", required = true, in = ParameterIn.QUERY, example = "123456") String phoneCode,
HttpServletResponse response) {
//do something
}
@wltj920,
You should pass as described by @debargharoy or wrap put your parameters inside an object and pass them as a @RequestBody
.
Describe the bug When I add
HttpServletRequest
parameter orHttpServletResponse
parameter into a interface and other parameters did not use the@RequestParam
annotation, the swagger ui ask me add a request body by json, and the header content type is updated toapplication/json
, but I didn't use@RequestBody
anywhere.The example code like: