有两个对象用了同一个@ApiModel的value值
今天发现不管怎么修改如下对象,接口显示总是不变
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "账单查询对象",description = "请求参数类")
public class QueryBillVO {
@ApiModelProperty(value = "页码",example = "1",required = false)
private Long page = 1l;
@ApiModelProperty(value = "每页显示条数",example = "10",required = false)
private Long size = 10l;
@ApiModelProperty(value = "账单范围 private/group/all",example = "private/group/all",required = true)
private String area;
@ApiModelProperty(value = "支付类型 0支付/1收入",example = "0",required = false)
private Integer type;
}
后来发现原来是两个查询对象的 @ApiModel中的value都使用了同一个值,在swagger页面上显示是就只显示先放入bean的那一个
/**
* @author lzp
* @date 2021/4/23 2:29
* 通用查询bean
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "查询通用对象",description = "请求参数类")
public class QueryVO {
@ApiModelProperty(value = "页码",example = "1",required = false)
private Long page = 1l;
@ApiModelProperty(value = "每页显示条数",example = "10",required = false)
private Long size = 10l;
@ApiModelProperty(value = "登录用户的id",example = "1",required = false)
private Integer userId;
}
保持value不一样即可
以上就是解决Swagger修改请求对象字段文档不更新问题的详细内容,更多关于Swagger修改字段更新文档的资料请关注html5模板网其它相关文章!