diff --git a/src/main/java/git/tracehub/pmo/controller/ProjectController.java b/src/main/java/git/tracehub/pmo/controller/ProjectController.java index 0a37ce7..63db58c 100644 --- a/src/main/java/git/tracehub/pmo/controller/ProjectController.java +++ b/src/main/java/git/tracehub/pmo/controller/ProjectController.java @@ -33,6 +33,7 @@ import git.tracehub.pmo.security.ClaimOf; import git.tracehub.pmo.security.IdProvider; import git.tracehub.pmo.security.IdpToken; +import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import java.util.List; import java.util.Map; @@ -84,6 +85,7 @@ public class ProjectController { * @return List of projects */ @GetMapping + @Operation(summary = "Get projects by user") public List byUser(@AuthenticationPrincipal final Jwt jwt) { return this.projects.byUser( new ClaimOf(jwt, "preferred_username").value() @@ -97,6 +99,7 @@ public List byUser(@AuthenticationPrincipal final Jwt jwt) { * @return Project */ @GetMapping("/{id}") + @Operation(summary = "Get project by id") @PreAuthorize("@hasProject.validate(#id)") public Project byId(@PathVariable final UUID id) { return this.projects.byId(id); @@ -111,6 +114,7 @@ public Project byId(@PathVariable final UUID id) { * @checkstyle MethodBodyCommentsCheck (20 lines) */ @PostMapping + @Operation(summary = "Create a new project") @PreAuthorize("hasAuthority('user_github') || hasAuthority('user_gitlab')") @ResponseStatus(HttpStatus.CREATED) public Project employ( diff --git a/src/main/java/git/tracehub/pmo/controller/SecretController.java b/src/main/java/git/tracehub/pmo/controller/SecretController.java index 82c28c4..7ed2165 100644 --- a/src/main/java/git/tracehub/pmo/controller/SecretController.java +++ b/src/main/java/git/tracehub/pmo/controller/SecretController.java @@ -30,6 +30,7 @@ import git.tracehub.pmo.secret.Keys; import git.tracehub.pmo.secret.Secret; import git.tracehub.pmo.secret.Secrets; +import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import java.util.List; import java.util.UUID; @@ -84,6 +85,7 @@ public SecretController( * @return List of keys */ @GetMapping("/keys") + @Operation(summary = "Get keys by project") public List byProject(@RequestParam final UUID project) { return this.keys.byProject(project); } @@ -95,6 +97,7 @@ public List byProject(@RequestParam final UUID project) { * @return Secret */ @GetMapping + @Operation(summary = "Get value by key") public Secret byValue(final Key key) { return this.secrets.value(key); } @@ -106,6 +109,7 @@ public Secret byValue(final Key key) { * @return Secret */ @PutMapping + @Operation(summary = "Update secret") public Secret update(@RequestBody @Valid final RqSecret secret) { return this.secrets.update(new SecretFromReq(secret)); } @@ -117,6 +121,7 @@ public Secret update(@RequestBody @Valid final RqSecret secret) { * @return Secret */ @PostMapping + @Operation(summary = "Create a new secret") @ResponseStatus(HttpStatus.CREATED) public Secret create(@RequestBody @Valid final RqSecret secret) { return this.secrets.create(new SecretFromReq(secret)); diff --git a/src/main/java/git/tracehub/pmo/controller/TicketController.java b/src/main/java/git/tracehub/pmo/controller/TicketController.java index e0ebbec..d08e72c 100644 --- a/src/main/java/git/tracehub/pmo/controller/TicketController.java +++ b/src/main/java/git/tracehub/pmo/controller/TicketController.java @@ -28,6 +28,7 @@ import git.tracehub.pmo.controller.request.TicketFromReq; import git.tracehub.pmo.ticket.Ticket; import git.tracehub.pmo.ticket.Tickets; +import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import java.util.Optional; import lombok.RequiredArgsConstructor; @@ -64,6 +65,7 @@ public class TicketController { * @return Ticket */ @GetMapping + @Operation(summary = "Get ticket by job path or issue number") public Ticket byJob( @RequestParam final String repo, @RequestParam final Optional job, @@ -89,6 +91,7 @@ public Ticket byJob( * @return Ticket */ @PostMapping + @Operation(summary = "Create a new ticket") @ResponseStatus(HttpStatus.CREATED) public Ticket create(@RequestBody @Valid final RqTicket ticket) { return this.tickets.create(new TicketFromReq(ticket));