Swagger - 如何在DTO中为int设置默认值0

时间:2015-10-08 04:16:25

标签: java json swagger dto

我的代码:

@ApiModelProperty(required = true, value = "")
@JsonProperty(value="id")
public int getWareHouseID() {
    return wareHouseID;
}

public void setWareHouseID(int wareHouseID) {
    this.wareHouseID = wareHouseID;
}

@ApiModelProperty(required = true, value = "")
@JsonProperty(value="pId")
public int getParentID() {
    return parentID;
}

public void setParentID(int parentID) {
    this.parentID = parentID;
}

swagger的结果:

  

{     “name”:“string”,     “wareHouseID”:“int”,     “公司”:“字符串”,     “fullname”:“string”,     “地址”:“字符串”,     “parentID”:“int”   }

我的问题:为什么int的结果是String?我如何设置默认值为:0。

谢谢大家。

0 个答案:

没有答案
相关问题