Skip to content

Commit

Permalink
Merge pull request PaperMC#187 from rtm516/fix/buildnumber
Browse files Browse the repository at this point in the history
Switch to `@Positive` instead of `@Pattern` for buildNumber
  • Loading branch information
kashike authored Feb 18, 2024
2 parents e7181a7 + 4ea51c4 commit 8aacd29
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 @@ -42,6 +42,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Positive;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
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 @@ -39,6 +39,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Positive;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
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 8aacd29

Please sign in to comment.