【发布时间】:2020-10-26 21:38:21
【问题描述】:
使用 Spring Data Rest,put 和 patch 请求都将在 beforeSave 中注册,因此它们将使用相同的验证器。
@Override
protected void configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener v) {
v.addValidator("beforeSave", new BeforeSaveValidator());
}
有没有办法为put 和patch 请求注册不同的验证器?
【问题讨论】:
标签: spring spring-boot spring-data-rest