我们如何确保列表中的各个字符串不是空/空白或遵循特定模式
@NotNull
List<String> emailIds;
我也想加个图案
@Pattern("\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b.")
但我可以没有它。但我肯定希望有一个约束来检查列表中的任何字符串是否为空或空白。还有 Json 模式的样子
"ids": {
"description": "The ids associated with this.",
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"required" :true }
}
"required" :true does not seem to do the job