1
、私は以下のように私の親DTOと子DTOの豆検証注釈付きのリストを注釈付きいますchildNameが子供の一つに空の場合春の注釈の検証とインデックスSpring MVCので
class ParentDto {
@NotBlank
private String parentName;
@Valid
private Set<ChildDto> childList;
//getter and setter
}
class ChildDto {
@NotBlank
private String childName;
//getter and setter
}
子オブジェクトのインデックスのないよう、以下のオブジェクトは、その後、スプリングリターンエラーメッセージ:
:[{"errorCode":"NotNull","field":"parentDto.childList[].childDto ","message":"may not be null"}]
はどのようにインデックス(子供が問題を抱えている占い)以下のようなものを使用してメッセージを返すために、スプリング有効にすることができます
[{"errorCode":"NotNull","field":"parentDto.childList[1].childDto ","message":"may not be null"}]