spring-boot-starter-swagger
spring-boot-starter-swagger copied to clipboard
加入swagger 并且加入校验器之后,对应的接收对象就变成了json的了,有什么好的方式进行解决
不好意思,没有get到问题点。。。
在参数没有加上@Valid的时候是这样的

/**
* @author egan
* @email [email protected]
* @date 2018/2/8
*/
@RequestMapping("swg")
@RestController
public class SwgTest extends BaseController{
@ApiOperation(value = "测试Swg")
@RequestMapping(value = "test", method = RequestMethod.POST)
public Map<String, Object> test( SwgBean body){
return successData();
}
}
然后加上之后变成这样了

/**
* @author egan
* @email [email protected]
* @date 2018/2/8
*/
@RequestMapping("swg")
@RestController
public class SwgTest extends BaseController{
@ApiOperation(value = "测试Swg")
@RequestMapping(value = "test", method = RequestMethod.POST)
public Map<String, Object> test(@Valid SwgBean body){
return successData();
}
}
试一下:@RequestParam @Valid SwgBean body