swagger2和springboot整合时,controller里面方法的请求参数是一个实体对象,但是生成api文档时不需要实体对象的所有属性作为请求参数。
controller方法如下
@ApiOperation(value = "测试隐藏属性",httpMethod = "GET")
@RequestMapping("/testHidden")
public String testHidden(@ModelAttribute User user){
return "success";
}
实体对象属性加了hidden注解但是在接口文档中并没有隐藏,有谁知道怎么解决吗?
@ApiModel
public class User {
private Long id;
@ApiModelProperty(hidden = true)
private String name;
private Integer age;
我想隐藏name参数,怎么解决?
All annotations can be implemented by importing the io.swagger.annotations package
Owner, has the problem been solved?