diff --git a/build.gradle b/build.gradle index fe597305..a815a2d9 100644 --- a/build.gradle +++ b/build.gradle @@ -41,11 +41,11 @@ wrapper { } dependencies { - compile "io.swagger:swagger-annotations:${swaggerAnnotationsVersion}" - compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" - compile "javax.validation:validation-api:${validationApiVersion}" - compile "org.apache.commons:commons-lang3:${commonsLangVersion}" - compile group: 'com.google.guava', name: 'guava', version: '28.2-jre' + implementation "org.springdoc:springdoc-openapi-data-rest:${sprindocAnnotationsVersion}" + implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" + implementation "javax.validation:validation-api:${validationApiVersion}" + implementation "org.apache.commons:commons-lang3:${commonsLangVersion}" + implementation group: 'com.google.guava', name: 'guava', version: '28.2-jre' // add lombok support compileOnly "org.projectlombok:lombok:${lombokVersion}" diff --git a/gradle.properties b/gradle.properties index 54f4a148..e40e9de4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ hibernateValidatorVersion=6.1.2.Final validationApiVersion=2.0.1.Final junitVersion=4.12 elApiVersion=3.0.0 -swaggerAnnotationsVersion=1.6.0 +sprindocAnnotationsVersion=1.7.0 commonsLangVersion=3.9 mockitoJunitJupiter=2.23.0 jacksonVersion=2.10.2 diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java index b2aee9cc..5de5b47c 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java @@ -19,7 +19,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import java.util.Date; import javax.validation.constraints.NotNull; @@ -33,37 +34,37 @@ public class ActivityResource { @NotNull @JsonProperty(value = "id", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Long id; @NotNull @JsonProperty(value = "user", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String user; @NotNull @JsonProperty(value = "loggedObjectId", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Long loggedObjectId; @NotNull @JsonProperty(value = "lastModified", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date lastModified; @NotNull @JsonProperty(value = "actionType", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String actionType; @NotNull @JsonProperty(value = "objectType", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String objectType; @NotNull @JsonProperty(value = "projectId", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Long projectId; @JsonProperty(value = "projectName") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java index 40478e77..5c9b6ee5 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java @@ -22,8 +22,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -44,12 +45,12 @@ public class FinishExecutionRQ { @NotNull @JsonProperty(value = "endTime", required = true) @JsonAlias({ "endTime", "end_time" }) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date endTime; @JsonProperty(value = "status") @In(allowedValues = { "passed", "failed", "stopped", "skipped", "interrupted", "cancelled", "info", "warn" }) - @ApiModelProperty(allowableValues = "PASSED, FAILED, STOPPED, SKIPPED, INTERRUPTED, CANCELLED, INFO, WARN") + @Schema(allowableValues = "PASSED, FAILED, STOPPED, SKIPPED, INTERRUPTED, CANCELLED, INFO, WARN") private String status; @JsonProperty(value = "description") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java index 6df53469..3395489f 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java @@ -20,8 +20,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.Valid; @JsonInclude(Include.NON_NULL) @@ -35,7 +36,7 @@ public class FinishTestItemRQ extends FinishExecutionRQ { private Boolean retry; @JsonProperty(value = "launchUuid") - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String launchUuid; @JsonProperty(value = "testCaseId") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java index 992ae3e5..d78f5962 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java @@ -21,8 +21,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -40,7 +41,7 @@ public class StartRQ { @JsonProperty(value = "name", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) protected String name; @JsonProperty(value = "description") @@ -55,10 +56,10 @@ public class StartRQ { @NotNull @JsonProperty(required = true) @JsonAlias({ "startTime", "start_time" }) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date startTime; - @ApiModelProperty(hidden = true) + @Schema(hidden = true) @JsonProperty(value = "uuid") private String uuid; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java index 6828ee9c..d9c7398e 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java @@ -28,8 +28,8 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -58,7 +58,7 @@ public class StartTestItemRQ extends StartRQ { @NotNull @JsonAlias({ "launchUuid", "launch_id" }) - @ApiModelProperty(value = "UUID of parent launch", required = true) + @Schema(description = "UUID of parent launch", required = true) private String launchUuid; @NotNull @@ -67,7 +67,7 @@ public class StartTestItemRQ extends StartRQ { @JsonDeserialize(using = UpperCaseTypeDeserializer.class) @In(allowedValues = { "suite", "story", "test", "scenario", "step", "before_class", "before_groups", "before_method", "before_suite", "before_test", "after_class", "after_groups", "after_method", "after_suite", "after_test" }) - @ApiModelProperty(required = true, allowableValues = "SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS," + @Schema(required = true, allowableValues = "SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS," + "BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST") private String type; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java index a00d483f..1d450c9a 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java @@ -16,7 +16,7 @@ package com.epam.ta.reportportal.ws.model.attribute; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; /** @@ -24,7 +24,7 @@ */ public class ItemAttributesRQ extends ItemAttributeResource implements Serializable { - @ApiModelProperty(example = "false") + @Schema(example = "false") private boolean system; public ItemAttributesRQ() { diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java index 9a80df69..205130b5 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java @@ -18,15 +18,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.NotEmpty; /** * @author Ihar Kahadouski */ -@ApiModel +@Schema @JsonInclude(JsonInclude.Include.NON_NULL) public class SamlResource extends AbstractAuthResource { diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java index fd97a1e2..5fcac188 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; @JsonInclude(Include.NON_NULL) public class StartLaunchRQ extends StartRQ { @@ -34,7 +34,7 @@ public class StartLaunchRQ extends StartRQ { private boolean rerun; @JsonProperty("rerunOf") - @ApiModelProperty(value = "UUID of desired launch to rerun") + @Schema(description = "UUID of desired launch to rerun") private String rerunOf; @Override diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java index e2d50c0e..a31b53fb 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java @@ -21,8 +21,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.constraints.NotNull; import java.util.Arrays; import java.util.Date; @@ -38,23 +39,23 @@ public class SaveLogRQ { private String uuid; @JsonAlias({ "itemUuid", "item_id" }) - @ApiModelProperty(value = "UUID of test item owned this log") + @Schema(description = "UUID of test item owned this log") private String itemUuid; @JsonProperty(value = "launchUuid") - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String launchUuid; @NotNull @JsonProperty(value = "time", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date logTime; @JsonProperty(value = "message") private String message; @JsonProperty(value = "level") - @ApiModelProperty(allowableValues = "error, warn, info, debug, trace, fatal, unknown") + @Schema(allowableValues = "error, warn, info, debug, trace, fatal, unknown") private String level; @JsonProperty(value = "file") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java b/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java index 4f1314ac..69bbc5b8 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java @@ -19,9 +19,8 @@ import com.epam.ta.reportportal.ws.annotations.In; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.Max; import javax.validation.constraints.Min; @@ -31,6 +30,7 @@ * @author Pavel Bortnik */ @JsonInclude(JsonInclude.Include.NON_NULL) +@Schema public class AnalyzerConfig { @Min(value = MIN_SHOULD_MATCH) @@ -52,11 +52,11 @@ public class AnalyzerConfig { @JsonProperty(value = "analyzerMode") @In(allowedValues = { "all", "launch_name", "current_launch", "previous_launch", "current_and_the_same_name" }) - @ApiModelProperty(allowableValues = "ALL, LAUNCH_NAME, CURRENT_LAUNCH, PREVIOUS_LAUNCH, CURRENT_AND_THE_SAME_NAME") + @Schema(allowableValues = "ALL, LAUNCH_NAME, CURRENT_LAUNCH, PREVIOUS_LAUNCH, CURRENT_AND_THE_SAME_NAME") private String analyzerMode; @JsonProperty(value = "indexingRunning") - @ApiParam(hidden = true) + @Schema(hidden = true) private boolean indexingRunning; @JsonProperty(value = "allMessagesShouldMatch") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java index 8792d99a..e2e10682 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import java.io.Serializable; @@ -56,10 +57,12 @@ public class OAuthRegistrationResource implements Serializable { @Pattern(regexp = URL_PATTERN) @JsonProperty(value = "authorizationUri") + @Schema(type = "string", pattern = URL_PATTERN, example = "string") private String authorizationUri; @Pattern(regexp = URL_PATTERN) @JsonProperty(value = "tokenUri") + @Schema(type = "string", pattern = URL_PATTERN, example = "string") private String tokenUri; @JsonProperty(value = "userInfoEndpointUri")