Skip to content

Commit b361a41

Browse files
fix: validating the array list items
1 parent 6339765 commit b361a41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

techchallenge/src/main/java/br/com/grupo63/techchallenge/adapter/in/controller/order/dto/CreateOrderRequestDTO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import br.com.grupo63.techchallenge.core.application.usecase.dto.OrderItemDTO;
66
import br.com.grupo63.techchallenge.core.application.usecase.dto.PaymentDTO;
77
import br.com.grupo63.techchallenge.core.domain.model.payment.PaymentMethod;
8+
import jakarta.validation.Valid;
89
import jakarta.validation.constraints.Min;
910
import jakarta.validation.constraints.NotNull;
1011
import jakarta.validation.constraints.Size;
@@ -34,6 +35,7 @@ public static class Item {
3435
private Long quantity;
3536
}
3637

38+
@Valid
3739
@NotNull(message = "order.create.items.notEmpty")
3840
@Size(min = 1, message = "order.create.items.notEmpty")
3941
private List<Item> items;

0 commit comments

Comments
 (0)