我有一个用hibernate验证器注释注释的POJO:
public class UserDto {
@Length(min = 2, max = 5)
@NotEmpty
private String name;
@Length(min = 8)
@NotEmpty
private String password;
//getters and setters
}
从这个POJO我希望能够生成如下所示的模式:
{"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"password": {
"type": "string",
"minLength" : 2,
"maxLength" : 5,
"required" : true
},
"name": {
"type": "string"
"minLength" : 8,
"required" : true
}
}
}
是否有能够执行此操作的库?
我正在看https://github.com/FasterXML/jackson,但我没有看到开箱即用的支持。
指针将非常受欢迎! 谢谢!