Skip to content

Commit

Permalink
Fix buildNumber causing errors when using @pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Feb 18, 2024
1 parent 40908aa commit e6735d7
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.Files;
import java.nio.file.Path;
import java.time.Duration;
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 @@ -157,7 +158,7 @@ public ResponseEntity<?> downloadSpecific(
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 @@ -115,7 +116,7 @@ public ResponseEntity<?> buildSpecific(
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 e6735d7

Please sign in to comment.