From de0756a08e4a2627c6724d70c6a57310ca61eece Mon Sep 17 00:00:00 2001 From: Antony Leons Date: Fri, 5 Jan 2024 16:04:26 +0000 Subject: [PATCH] bump validation --- pom.xml | 8 ++++---- .../leons/ward/controllers/SetupController.java | 2 +- src/main/java/dev/leons/ward/dto/SetupDto.java | 16 +++++++--------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index ce53ef09..e7dc3b5a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 dev.leons ward - 2.4.0 + 2.4.1 jar @@ -40,9 +40,9 @@ spring-boot-starter-validation - javax.validation - validation-api - 2.0.1.Final + jakarta.validation + jakarta.validation-api + 3.0.2 com.github.oshi diff --git a/src/main/java/dev/leons/ward/controllers/SetupController.java b/src/main/java/dev/leons/ward/controllers/SetupController.java index 6d40a0b6..80db4140 100644 --- a/src/main/java/dev/leons/ward/controllers/SetupController.java +++ b/src/main/java/dev/leons/ward/controllers/SetupController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.io.IOException; /** diff --git a/src/main/java/dev/leons/ward/dto/SetupDto.java b/src/main/java/dev/leons/ward/dto/SetupDto.java index 715ee9fa..272c9be3 100644 --- a/src/main/java/dev/leons/ward/dto/SetupDto.java +++ b/src/main/java/dev/leons/ward/dto/SetupDto.java @@ -1,15 +1,14 @@ package dev.leons.ward.dto; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; import lombok.Getter; import lombok.Setter; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; - /** * SetupDto is a values container for setup data * @@ -24,8 +23,7 @@ public class SetupDto * Server name Field */ @NotNull - @NotEmpty - @Size(min = 1, max = 10) + @Size(min = 0, max = 10) private String serverName; /**