You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect maxLength and minLength so swagger validates it correctly.
Interestingly, if you remove the Size annotation minLength/maxLength are generated correctly.
My Model has:
public class MyRDO {
private String transferId = null;
public MyRDO transferId(String transferId) {
this.transferId= transferId;
return this;
}
@JsonProperty("transferId")
@ApiModelProperty(required = true, value = "<p>Transfer Id</p>") @NotNull@Pattern(regexp="^[A-Za-z0-9]{8,16}$") @Size(min=8,max=16)
public String getTransferId() {
return transferId;
}
public void setTransferId(String transferId) {
this.transferId = transferId;
}
}
Version: 2.8.0
Latest Version: 2.9.0
What kind of issue is this?
Bug Report - JSR-303 Size not generated correctly when specified on a String path parameter
When a String ApiParam is specified with a Size, the json is generated with minimum and maximum instead of rhe expected minLength and maxLength.
However is Size is specified on a string field in a request object, maxLength and minLength are generated correctly.
I might be barking up the wrong tree here, but this is what I have and what I am seeing.
MyApplication.java has the following annotations:
My Controller has:
Which generates the following json:
I would expect maxLength and minLength so swagger validates it correctly.
Interestingly, if you remove the Size annotation minLength/maxLength are generated correctly.
My Model has:
Which generates:
Sample Repo Created - https://github.com/retinaburn/sizetest/tree/master/src/main/java/io/springfox/custom
The text was updated successfully, but these errors were encountered: