diff options
author | Jacek Poreda <jacek.poreda@sonarsource.com> | 2024-12-11 13:08:24 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-12-18 20:03:11 +0000 |
commit | 6a146e820674a08f14b03db7f48f3ec7d393d38b (patch) | |
tree | 18e1663e8c7399f31bbc99f627d5223adfe472b3 /server/sonar-webserver-webapi-v2 | |
parent | 086f2ce821d41363460d1b897b3631dc498524c5 (diff) | |
download | sonarqube-6a146e820674a08f14b03db7f48f3ec7d393d38b.tar.gz sonarqube-6a146e820674a08f14b03db7f48f3ec7d393d38b.zip |
SONAR-19122 Upgrade to Spring 6
Diffstat (limited to 'server/sonar-webserver-webapi-v2')
35 files changed, 64 insertions, 70 deletions
diff --git a/server/sonar-webserver-webapi-v2/build.gradle b/server/sonar-webserver-webapi-v2/build.gradle index 0b65a6ad13a..7e75b599c05 100644 --- a/server/sonar-webserver-webapi-v2/build.gradle +++ b/server/sonar-webserver-webapi-v2/build.gradle @@ -6,11 +6,11 @@ sonarqube { dependencies { // please keep the list grouped by configuration and ordered by name - api 'org.springdoc:springdoc-openapi-webmvc-core' + api 'org.springdoc:springdoc-openapi-starter-webmvc-api' api 'org.springframework:spring-webmvc' api 'org.hibernate.validator:hibernate-validator' api 'jakarta.el:jakarta.el-api' - api 'org.glassfish:jakarta.el' + api 'org.glassfish.expressly:expressly' api project(':server:sonar-db-dao') api project(':server:sonar-webserver-common') diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/controller/Searchable.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/controller/Searchable.java index 7a5296ea7c7..c623ca24a44 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/controller/Searchable.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/controller/Searchable.java @@ -19,11 +19,11 @@ */ package org.sonar.server.v2.api.controller; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.model.RestPage; import org.sonar.server.v2.api.request.RestSearchRequest; import org.sonar.server.v2.api.response.RestSearchResponse; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; public interface Searchable<T, U extends RestSearchRequest> { diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/controller/EmailConfigurationController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/controller/EmailConfigurationController.java index 01eef1272c1..827477d74c6 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/controller/EmailConfigurationController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/controller/EmailConfigurationController.java @@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.email.config.request.EmailConfigurationCreateRestRequest; import org.sonar.server.v2.api.email.config.request.EmailConfigurationUpdateRestRequest; import org.sonar.server.v2.api.email.config.resource.EmailConfigurationResource; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/request/EmailConfigurationCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/request/EmailConfigurationCreateRestRequest.java index 0034d8feacb..631957ecc25 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/request/EmailConfigurationCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/request/EmailConfigurationCreateRestRequest.java @@ -21,8 +21,8 @@ package org.sonar.server.v2.api.email.config.request; import io.swagger.v3.oas.annotations.media.Schema; import javax.annotation.Nullable; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.sonar.server.v2.api.email.config.resource.EmailConfigurationAuthMethod; import org.sonar.server.v2.api.email.config.resource.EmailConfigurationSecurityProtocol; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/controller/GithubConfigurationController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/controller/GithubConfigurationController.java index eb6865db0ee..b9863468a91 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/controller/GithubConfigurationController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/controller/GithubConfigurationController.java @@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.github.config.request.GithubConfigurationCreateRestRequest; import org.sonar.server.v2.api.github.config.request.GithubConfigurationUpdateRestRequest; import org.sonar.server.v2.api.github.config.resource.GithubConfigurationResource; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/request/GithubConfigurationCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/request/GithubConfigurationCreateRestRequest.java index d5cf09c7169..c4e82f98992 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/request/GithubConfigurationCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/github/config/request/GithubConfigurationCreateRestRequest.java @@ -23,8 +23,8 @@ import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import javax.annotation.Nullable; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.sonar.server.v2.api.model.ProvisioningType; public record GithubConfigurationCreateRestRequest( diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/controller/GitlabConfigurationController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/controller/GitlabConfigurationController.java index 3329649d4f8..2ec2cf3f9ca 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/controller/GitlabConfigurationController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/controller/GitlabConfigurationController.java @@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.gitlab.config.request.GitlabConfigurationCreateRestRequest; import org.sonar.server.v2.api.gitlab.config.request.GitlabConfigurationUpdateRestRequest; import org.sonar.server.v2.api.gitlab.config.resource.GitlabConfigurationResource; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationCreateRestRequest.java index 837328970ed..6a8f4a28780 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationCreateRestRequest.java @@ -23,8 +23,8 @@ import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import javax.annotation.Nullable; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.sonar.server.v2.api.model.ProvisioningType; public record GitlabConfigurationCreateRestRequest( diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationUpdateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationUpdateRestRequest.java index 57e38b911dd..3f82182b0d2 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationUpdateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/request/GitlabConfigurationUpdateRestRequest.java @@ -22,7 +22,7 @@ package org.sonar.server.v2.api.gitlab.config.request; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import org.sonar.server.v2.api.model.ProvisioningType; import org.sonar.server.v2.common.model.UpdateField; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/controller/GroupController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/controller/GroupController.java index 87dadb7fa24..1e6b3917055 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/controller/GroupController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/controller/GroupController.java @@ -22,14 +22,14 @@ package org.sonar.server.v2.api.group.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.group.request.GroupCreateRestRequest; import org.sonar.server.v2.api.group.request.GroupUpdateRestRequest; import org.sonar.server.v2.api.group.request.GroupsSearchRestRequest; import org.sonar.server.v2.api.group.response.GroupRestResponse; import org.sonar.server.v2.api.group.response.GroupsSearchRestResponse; import org.sonar.server.v2.api.model.RestPage; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupCreateRestRequest.java index 88049db9bfe..54a6198fa6d 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupCreateRestRequest.java @@ -21,8 +21,8 @@ package org.sonar.server.v2.api.group.request; import io.swagger.v3.oas.annotations.media.Schema; import javax.annotation.Nullable; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Size; import static org.sonar.api.user.UserGroupValidation.GROUP_NAME_MAX_LENGTH; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupUpdateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupUpdateRestRequest.java index 4037e7b393d..964cf52eba2 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupUpdateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/group/request/GroupUpdateRestRequest.java @@ -20,7 +20,7 @@ package org.sonar.server.v2.api.group.request; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import org.sonar.server.v2.common.model.UpdateField; import static org.sonar.api.user.UserGroupValidation.GROUP_NAME_MAX_LENGTH; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/membership/controller/GroupMembershipController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/membership/controller/GroupMembershipController.java index 6fdc918b8da..420d7324616 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/membership/controller/GroupMembershipController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/membership/controller/GroupMembershipController.java @@ -22,13 +22,13 @@ package org.sonar.server.v2.api.membership.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.membership.request.GroupMembershipCreateRestRequest; import org.sonar.server.v2.api.membership.request.GroupsMembershipSearchRestRequest; import org.sonar.server.v2.api.membership.response.GroupsMembershipSearchRestResponse; import org.sonar.server.v2.api.membership.response.GroupMembershipRestResponse; import org.sonar.server.v2.api.model.RestPage; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/controller/ModeController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/controller/ModeController.java index 7bd89a595cf..40d62399639 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/controller/ModeController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/controller/ModeController.java @@ -22,7 +22,7 @@ package org.sonar.server.v2.api.mode.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.mode.resources.ModeResource; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.GetMapping; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/resources/ModeResource.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/resources/ModeResource.java index 90c866d150c..4839c9167a4 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/resources/ModeResource.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/mode/resources/ModeResource.java @@ -20,7 +20,7 @@ package org.sonar.server.v2.api.mode.resources; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.sonar.server.v2.api.mode.enums.ModeEnum; public record ModeResource( diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java index 3e4aeb53e2f..87dd2c81e85 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java @@ -21,10 +21,10 @@ package org.sonar.server.v2.api.model; import com.google.common.annotations.VisibleForTesting; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.Positive; -import javax.validation.constraints.PositiveOrZero; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.Positive; +import jakarta.validation.constraints.PositiveOrZero; import org.jetbrains.annotations.Nullable; public record RestPage( diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/controller/ProjectBindingsController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/controller/ProjectBindingsController.java index baf77a69ddf..f2d8a119d34 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/controller/ProjectBindingsController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/controller/ProjectBindingsController.java @@ -24,12 +24,12 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.model.RestPage; import org.sonar.server.v2.api.projectbindings.model.ProjectBinding; import org.sonar.server.v2.api.projectbindings.request.ProjectBindingsSearchRestRequest; import org.sonar.server.v2.api.projectbindings.response.ProjectBindingsSearchRestResponse; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/model/ProjectBinding.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/model/ProjectBinding.java index 8f7e502d5ae..772c7b43dac 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/model/ProjectBinding.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projectbindings/model/ProjectBinding.java @@ -20,7 +20,7 @@ package org.sonar.server.v2.api.projectbindings.model; import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public record ProjectBinding ( diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/controller/BoundProjectsController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/controller/BoundProjectsController.java index 4ae3255162e..2e095e06f51 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/controller/BoundProjectsController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/controller/BoundProjectsController.java @@ -20,7 +20,7 @@ package org.sonar.server.v2.api.projects.controller; import io.swagger.v3.oas.annotations.Operation; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.projects.request.BoundProjectCreateRestRequest; import org.sonar.server.v2.api.projects.response.BoundProjectCreateRestResponse; import org.springframework.http.HttpStatus; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/request/BoundProjectCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/request/BoundProjectCreateRestRequest.java index ce9809a3dd0..e35a4ad4e71 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/request/BoundProjectCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/projects/request/BoundProjectCreateRestRequest.java @@ -21,8 +21,8 @@ package org.sonar.server.v2.api.projects.request; import io.swagger.v3.oas.annotations.media.Schema; import javax.annotation.Nullable; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; public record BoundProjectCreateRestRequest( diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/controller/RuleController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/controller/RuleController.java index b73a8440d22..45ac60908dd 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/controller/RuleController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/controller/RuleController.java @@ -22,7 +22,7 @@ package org.sonar.server.v2.api.rule.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.sonar.server.v2.api.rule.request.RuleCreateRestRequest; import org.sonar.server.v2.api.rule.response.RuleRestResponse; import org.springframework.http.HttpStatus; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/request/RuleCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/request/RuleCreateRestRequest.java index 6552f28df0d..3db612d1ede 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/request/RuleCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/rule/request/RuleCreateRestRequest.java @@ -22,9 +22,9 @@ package org.sonar.server.v2.api.rule.request; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.sonar.api.rules.RuleType; import org.sonar.server.v2.api.rule.enums.CleanCodeAttributeRestEnum; import org.sonar.server.v2.api.rule.enums.RuleStatusRestEnum; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/controller/UserController.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/controller/UserController.java index fa189c71df1..0a3f3c42b9a 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/controller/UserController.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/controller/UserController.java @@ -25,15 +25,15 @@ import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.extensions.Extension; import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; import javax.annotation.Nullable; -import javax.validation.Valid; import org.sonar.server.v2.api.model.RestPage; -import org.sonar.server.v2.api.user.response.UserRestResponse; import org.sonar.server.v2.api.user.request.UserCreateRestRequest; import org.sonar.server.v2.api.user.request.UserUpdateRestRequest; import org.sonar.server.v2.api.user.request.UsersSearchRestRequest; +import org.sonar.server.v2.api.user.response.UserRestResponse; import org.sonar.server.v2.api.user.response.UsersSearchRestResponse; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserCreateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserCreateRestRequest.java index 4cb7953b936..bbf55d90dc7 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserCreateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserCreateRestRequest.java @@ -22,9 +22,9 @@ package org.sonar.server.v2.api.user.request; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import javax.annotation.Nullable; -import javax.validation.constraints.Email; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; public record UserCreateRestRequest( @Nullable diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserUpdateRestRequest.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserUpdateRestRequest.java index 86df618f040..00edfe89904 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserUpdateRestRequest.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/request/UserUpdateRestRequest.java @@ -23,8 +23,8 @@ import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import javax.annotation.Nullable; -import javax.validation.constraints.Email; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Size; import org.sonar.server.v2.common.model.UpdateField; public class UserUpdateRestRequest { diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/validation/UpdateFieldValueExtractor.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/validation/UpdateFieldValueExtractor.java index 1d78a93d708..1c23d518bf2 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/validation/UpdateFieldValueExtractor.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/validation/UpdateFieldValueExtractor.java @@ -19,9 +19,9 @@ */ package org.sonar.server.v2.api.validation; -import javax.validation.valueextraction.ExtractedValue; -import javax.validation.valueextraction.UnwrapByDefault; -import javax.validation.valueextraction.ValueExtractor; +import jakarta.validation.valueextraction.ExtractedValue; +import jakarta.validation.valueextraction.UnwrapByDefault; +import jakarta.validation.valueextraction.ValueExtractor; import org.sonar.server.v2.common.model.UpdateField; @UnwrapByDefault diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/DeprecatedHandler.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/DeprecatedHandler.java index 478d8ff5e81..a6712d8a8f5 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/DeprecatedHandler.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/DeprecatedHandler.java @@ -20,14 +20,14 @@ package org.sonar.server.v2.common; import java.lang.reflect.Field; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; import org.sonar.server.user.ThreadLocalUserSession; import org.sonar.server.user.UserSession; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.core.MethodParameter; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestParam; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmpty.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmpty.java index 7f69d3cad44..b2843f3379c 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmpty.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmpty.java @@ -23,8 +23,8 @@ import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.validation.Constraint; -import javax.validation.Payload; +import jakarta.validation.Constraint; +import jakarta.validation.Payload; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.CONSTRUCTOR; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidator.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidator.java index b6a40c694d0..ce137a0ca02 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidator.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidator.java @@ -20,8 +20,8 @@ package org.sonar.server.v2.common.model; import javax.annotation.Nullable; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; public class NullOrNotEmptyValidator implements ConstraintValidator<NullOrNotEmpty, String> { @Override diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/UpdateField.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/UpdateField.java index 9f4a942cf47..232a878ab12 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/UpdateField.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/common/model/UpdateField.java @@ -23,7 +23,7 @@ import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -import javax.validation.valueextraction.UnwrapByDefault; +import jakarta.validation.valueextraction.UnwrapByDefault; import org.sonar.server.common.NonNullUpdatedValue; import org.sonar.server.common.UpdatedValue; diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/CommonWebConfig.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/CommonWebConfig.java index 3ba5ee6eb43..273d665e93f 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/CommonWebConfig.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/CommonWebConfig.java @@ -22,7 +22,7 @@ package org.sonar.server.v2.config; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import org.sonar.server.v2.common.RestResponseEntityExceptionHandler; -import org.springdoc.core.SpringDocConfigProperties; +import org.springdoc.core.properties.SpringDocConfigProperties; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -45,7 +45,7 @@ public class CommonWebConfig implements WebMvcConfigurer { public void configurePathMatch(PathMatchConfigurer configurer) { UrlPathHelper urlPathHelper = new UrlPathHelper(); urlPathHelper.setUrlDecode(false); - configurer.setUrlPathHelper(urlPathHelper); + configurer.setUrlPathHelper(urlPathHelper).setUseTrailingSlashMatch(true); } @Bean diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/SafeModeWebConfig.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/SafeModeWebConfig.java index f235bd848b3..ca682d0638e 100644 --- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/SafeModeWebConfig.java +++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/config/SafeModeWebConfig.java @@ -20,9 +20,7 @@ package org.sonar.server.v2.config; import org.sonar.db.Database; -import org.sonar.server.common.health.DbConnectionNodeCheck; import org.sonar.server.common.platform.LivenessChecker; -import org.sonar.server.common.platform.SafeModeLivenessCheckerImpl; import org.sonar.server.health.HealthChecker; import org.sonar.server.platform.db.migration.DatabaseMigrationState; import org.sonar.server.platform.db.migration.version.DatabaseVersion; @@ -42,11 +40,6 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; public class SafeModeWebConfig { @Bean - public LivenessChecker livenessChecker(DbConnectionNodeCheck dbConnectionNodeCheck) { - return new SafeModeLivenessCheckerImpl(dbConnectionNodeCheck); - } - - @Bean public LivenessController livenessController(LivenessChecker livenessChecker, SystemPasscode systemPasscode) { return new DefaultLivenessController(livenessChecker, systemPasscode, null); } diff --git a/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/DeprecatedHandlerTest.java b/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/DeprecatedHandlerTest.java index 767349b6b96..1cd39f6b6e1 100644 --- a/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/DeprecatedHandlerTest.java +++ b/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/DeprecatedHandlerTest.java @@ -23,8 +23,8 @@ import com.tngtech.java.junit.dataprovider.DataProvider; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,7 +32,7 @@ import org.slf4j.event.Level; import org.sonar.api.testfixtures.log.LogTester; import org.sonar.server.user.ThreadLocalUserSession; import org.sonar.server.v2.api.ControllerTester; -import org.springdoc.api.annotations.ParameterObject; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.test.web.servlet.MockMvc; diff --git a/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidatorTest.java b/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidatorTest.java index 2b9799bda63..7ac4bb59667 100644 --- a/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidatorTest.java +++ b/server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/common/model/NullOrNotEmptyValidatorTest.java @@ -19,7 +19,7 @@ */ package org.sonar.server.v2.common.model; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -46,4 +46,4 @@ class NullOrNotEmptyValidatorTest { assertFalse(validator.isValid("", context)); } -}
\ No newline at end of file +} diff --git a/server/sonar-webserver-webapi-v2/src/testFixtures/java/org/sonar/server/v2/api/ControllerTester.java b/server/sonar-webserver-webapi-v2/src/testFixtures/java/org/sonar/server/v2/api/ControllerTester.java index 46a2df1a9c3..8a63eaaedc7 100644 --- a/server/sonar-webserver-webapi-v2/src/testFixtures/java/org/sonar/server/v2/api/ControllerTester.java +++ b/server/sonar-webserver-webapi-v2/src/testFixtures/java/org/sonar/server/v2/api/ControllerTester.java @@ -36,6 +36,7 @@ public class ControllerTester { .standaloneSetup(controllers) .setCustomHandlerMapping(() -> resolveRequestMappingHandlerMapping(handlerInterceptors)) .setControllerAdvice(new RestResponseEntityExceptionHandler()) + .setUseTrailingSlashPatternMatch(true) .build(); } |