mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
add schema for response headers
This commit is contained in:
@@ -2,6 +2,7 @@ package sonia.scm.api.v2.resources;
|
|||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
@@ -179,7 +180,15 @@ public class BranchRootResource {
|
|||||||
@Path("")
|
@Path("")
|
||||||
@Consumes(VndMediaType.BRANCH_REQUEST)
|
@Consumes(VndMediaType.BRANCH_REQUEST)
|
||||||
@Operation(summary = "Create branch", description = "Creates a new branch.", tags = "Repository")
|
@Operation(summary = "Create branch", description = "Creates a new branch.", tags = "Repository")
|
||||||
@ApiResponse(responseCode = "201", description = "create success")
|
@ApiResponse(
|
||||||
|
responseCode = "201",
|
||||||
|
description = "create success",
|
||||||
|
headers = @Header(
|
||||||
|
name = "Location",
|
||||||
|
description = "uri to the created branch",
|
||||||
|
schema = @Schema(type = "string")
|
||||||
|
)
|
||||||
|
)
|
||||||
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
||||||
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"push\" privilege")
|
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"push\" privilege")
|
||||||
@ApiResponse(responseCode = "409", description = "conflict, a branch with this name already exists")
|
@ApiResponse(responseCode = "409", description = "conflict, a branch with this name already exists")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
@@ -95,7 +96,15 @@ public class GroupCollectionResource {
|
|||||||
@Path("")
|
@Path("")
|
||||||
@Consumes(VndMediaType.GROUP)
|
@Consumes(VndMediaType.GROUP)
|
||||||
@Operation(summary = "Create group", description = "Creates a new group.", tags = "Group", operationId = "group_create")
|
@Operation(summary = "Create group", description = "Creates a new group.", tags = "Group", operationId = "group_create")
|
||||||
@ApiResponse(responseCode = "201", description = "create success")
|
@ApiResponse(
|
||||||
|
responseCode = "201",
|
||||||
|
description = "create success",
|
||||||
|
headers = @Header(
|
||||||
|
name = "Location",
|
||||||
|
description = "uri to the created group",
|
||||||
|
schema = @Schema(type = "string")
|
||||||
|
)
|
||||||
|
)
|
||||||
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
||||||
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"group\" privilege")
|
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"group\" privilege")
|
||||||
@ApiResponse(responseCode = "409", description = "conflict, a group with this name already exists")
|
@ApiResponse(responseCode = "409", description = "conflict, a group with this name already exists")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
@@ -103,7 +104,15 @@ public class RepositoryCollectionResource {
|
|||||||
@Path("")
|
@Path("")
|
||||||
@Consumes(VndMediaType.REPOSITORY)
|
@Consumes(VndMediaType.REPOSITORY)
|
||||||
@Operation(summary = "Create repository", description = "Creates a new repository.", tags = "Repository")
|
@Operation(summary = "Create repository", description = "Creates a new repository.", tags = "Repository")
|
||||||
@ApiResponse(responseCode = "201", description = "create success")
|
@ApiResponse(
|
||||||
|
responseCode = "201",
|
||||||
|
description = "create success",
|
||||||
|
headers = @Header(
|
||||||
|
name = "Location",
|
||||||
|
description = "uri to the created repository",
|
||||||
|
schema = @Schema(type = "string")
|
||||||
|
)
|
||||||
|
)
|
||||||
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
||||||
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"repository\" privilege")
|
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"repository\" privilege")
|
||||||
@ApiResponse(responseCode = "409", description = "conflict, a repository with this name already exists")
|
@ApiResponse(responseCode = "409", description = "conflict, a repository with this name already exists")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
@@ -67,7 +68,15 @@ public class RepositoryPermissionRootResource {
|
|||||||
@Path("")
|
@Path("")
|
||||||
@Consumes(VndMediaType.REPOSITORY_PERMISSION)
|
@Consumes(VndMediaType.REPOSITORY_PERMISSION)
|
||||||
@Operation(summary = "Create repository-specific permission", description = "Adds a new permission to the user or group managed by the repository.", tags = {"Repository", "Permissions"})
|
@Operation(summary = "Create repository-specific permission", description = "Adds a new permission to the user or group managed by the repository.", tags = {"Repository", "Permissions"})
|
||||||
@ApiResponse(responseCode = "201", description = "creates")
|
@ApiResponse(
|
||||||
|
responseCode = "201",
|
||||||
|
description = "creates",
|
||||||
|
headers = @Header(
|
||||||
|
name = "Location",
|
||||||
|
description = "uri of the created permission",
|
||||||
|
schema = @Schema(type = "string")
|
||||||
|
)
|
||||||
|
)
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
responseCode = "404",
|
responseCode = "404",
|
||||||
description = "not found",
|
description = "not found",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
@@ -90,7 +91,15 @@ public class RepositoryRoleCollectionResource {
|
|||||||
@Path("")
|
@Path("")
|
||||||
@Consumes(VndMediaType.REPOSITORY_ROLE)
|
@Consumes(VndMediaType.REPOSITORY_ROLE)
|
||||||
@Operation(summary = "Create repository role", description = "Creates a new repository role.", tags = "Repository role")
|
@Operation(summary = "Create repository role", description = "Creates a new repository role.", tags = "Repository role")
|
||||||
@ApiResponse(responseCode = "201", description = "create success")
|
@ApiResponse(
|
||||||
|
responseCode = "201",
|
||||||
|
description = "create success",
|
||||||
|
headers = @Header(
|
||||||
|
name = "Location",
|
||||||
|
description = "uri to the created repository role",
|
||||||
|
schema = @Schema(type = "string")
|
||||||
|
)
|
||||||
|
)
|
||||||
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
||||||
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"repositoryRole\" privilege")
|
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"repositoryRole\" privilege")
|
||||||
@ApiResponse(responseCode = "409", description = "conflict, a repository role with this name already exists")
|
@ApiResponse(responseCode = "409", description = "conflict, a repository role with this name already exists")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package sonia.scm.api.v2.resources;
|
package sonia.scm.api.v2.resources;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.headers.Header;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
@@ -99,7 +100,15 @@ public class UserCollectionResource {
|
|||||||
@Path("")
|
@Path("")
|
||||||
@Consumes(VndMediaType.USER)
|
@Consumes(VndMediaType.USER)
|
||||||
@Operation(summary = "Create user", description = "Creates a new user.", tags = "User")
|
@Operation(summary = "Create user", description = "Creates a new user.", tags = "User")
|
||||||
@ApiResponse(responseCode = "201", description = "create success")
|
@ApiResponse(
|
||||||
|
responseCode = "201",
|
||||||
|
description = "create success",
|
||||||
|
headers = @Header(
|
||||||
|
name = "Location",
|
||||||
|
description = "uri to the created user",
|
||||||
|
schema = @Schema(type = "string")
|
||||||
|
)
|
||||||
|
)
|
||||||
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
|
||||||
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"user\" privilege")
|
@ApiResponse(responseCode = "403", description = "not authorized, the current user does not have the \"user\" privilege")
|
||||||
@ApiResponse(responseCode = "409", description = "conflict, a user with this name already exists")
|
@ApiResponse(responseCode = "409", description = "conflict, a user with this name already exists")
|
||||||
|
|||||||
Reference in New Issue
Block a user