0
0

More than 1 year has passed since last update.

springでListのstringなどの要素にvalidationのアノテーションを付与

Posted at
import java.util.List;

import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
public class SampleRequest {
  List<@NotNull String> list;
}

アノテーションを自作する場合は ElementType.TYPE_USE を使用する。

@Target(java.lang.annotation.ElementType.TYPE_USE)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0