Skip to content

Commit

Permalink
Switch to @Positive instead of @Pattern for buildNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Feb 18, 2024
1 parent e7181a7 commit 31a9e27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.nio.file.Path;
import java.time.Duration;
import java.util.Map;
import jakarta.validation.constraints.Positive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.CacheControl;
Expand Down Expand Up @@ -121,7 +122,7 @@ public ResponseEntity<?> download(
final String versionName,
@Parameter(description = "A build of the version.")
@PathVariable("build")
@Pattern(regexp = "\\d+") //
@Positive //
final int buildNumber,
@Parameter(description = "A download of the build.")
@PathVariable("download")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.time.Instant;
import java.util.List;
import java.util.Map;
import jakarta.validation.constraints.Positive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.CacheControl;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -91,7 +92,7 @@ public ResponseEntity<?> build(
final String versionName,
@Parameter(description = "A build of the version.")
@PathVariable("build")
@Pattern(regexp = "\\d+") //
@Positive //
final int buildNumber
) {
final Project project = this.projects.findByName(projectName).orElseThrow(ProjectNotFound::new);
Expand Down

0 comments on commit 31a9e27

Please sign in to comment.