import javax.validation.constraints.Size;
class User {
@Size(min = 3)
private String name;
private String email;
@JsonCreator
public User(@JsonProperty(value = "name", required = true) String name,
@JsonProperty(value = "email") String email) {
this.name = name;
this.email = email;
}
}
Both are showed as required, api.json:
{"type":"object","required":["email","name"],"properties":{"name":{"type":"string"},"email":{"type":"string"}}}
@Size is not working, in api.json
"email":{"type":"string"}
but must be
{
"type": "string",
"minLength": 2
}
What I should add to work properly?
I am using compile group: "io.springfox", name: "springfox-swagger2", version: "2.6.1"