Swagger @ApiModelProperty 对象字段不显示

Swagger-ui中,接口请求对象字段不显示,查了半天,原来是大小写原因,首字母必须小写

错误代码:

@ApiModelProperty(value="用户",name="UserId",required=true)
    private Integer UserId;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

正确代码

@ApiModelProperty(value="用户",name="userId",required=true)
    private Integer userId;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

你可能感兴趣的:(java,java,swagger)