Skip to content

Commit 624a585

Browse files
committed
removed required
1 parent 30ba6e0 commit 624a585

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
package io.avaje.validation.adapter;
22

3-
public interface CoreValidation {
4-
5-
/** Return true to continue validation on this value if needed */
6-
boolean required(Object value, ValidationRequest ctx, String propertyName);
7-
}
3+
public interface CoreValidation {}
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
package io.avaje.validation.core;
22

33
import io.avaje.validation.adapter.CoreValidation;
4-
import io.avaje.validation.adapter.ValidationRequest;
54

65
final class DCoreValidation implements CoreValidation {
76

8-
@Override
9-
public boolean required(Object value, ValidationRequest ctx, String propertyName) {
10-
if (value == null) {
11-
ctx.addViolation("Required", propertyName);
12-
return false;
13-
}
14-
return true;
15-
}
7+
168
}

validator/src/test/java/io/avaje/validation/core/CustomerValidationAdapter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public boolean validate(Customer value, ValidationRequest request, String proper
5353
activeDateAdapter.validate(value.activeDate, request, "activeDate");
5454

5555
final var _billingAddress = value.billingAddress;
56-
if (core.required(_billingAddress, request, "billingAddress")) { // required / NotNull
5756
addressValidator.validate(_billingAddress, request, "billingAddress");
58-
}
5957

6058
final var _shippingAddress = value.shippingAddress;
6159
if (_shippingAddress != null) { // is nullable

0 commit comments

Comments
 (0)