I am using Jersey 1.2 (still using JDK 1.5) and have developed a REST Booking Web Resource and an associated Booking POJO.
I have used Bean Validation to restrict the size/type of the fields e.g.
@NotNull
@Size(message="invalid size",min=3,max=20)
@Pattern(message="invalid pattern",regexp = "^[A-Za-z]*")
@JsonProperty(value = "forename")
private String forename;
and have used the Jackson ObjectMapper.generateJsonSchema class to generate the JSON schema however this ignores all the validation annotations so I just get:
"forename" : {
"type" : "string"
}
Is there any way to include the restriction information as part of the generated schema?
Many thanks