matchers = Arrays.stream(getSecuredResourcesRoot())
+ .map(AntPathRequestMatcher::new)
+ .toList();
+ return new OrRequestMatcher(matchers.toArray(new AntPathRequestMatcher[0]));
+ }
+
+ public String[] getUnsecuredResources() {
+ return new String[]{
+ "/restapi/**", // Ensure JWT API paths are not secured by the SAML chain
+ "/saml2/web/**",
+ "/swagger-ui/**",
+ "/api-docs/**",
+ "/error-401.html"
+ };
+ }
+
+ public String[] getSecuredResourcesRoot() {
+ // This chain should only handle browser-based SAML flows and the main UI
+ return new String[]{
+ "/login/saml2/sso/**", // SAML Response consumer endpoint
+ "/saml2/**", // SAML metadata and other endpoints
+ "/" // Your application's root/UI entry point
+ };
+ }
+}
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/app/SecurityConfiguration.java b/server/catgenome/src/main/java/com/epam/catgenome/app/SecurityConfiguration.java
index 39d68c4a0..487c0188c 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/app/SecurityConfiguration.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/app/SecurityConfiguration.java
@@ -28,7 +28,7 @@
import org.springframework.context.annotation.Import;
@Configuration
-@Import({JWTSecurityConfiguration.class, SAMLSecurityConfiguration.class, NoSecurityConfiguration.class,
+@Import({JWTSecurityConfiguration.class, Saml2SecurityConfiguration.class, NoSecurityConfiguration.class,
AclSecurityConfiguration.class})
public class SecurityConfiguration {
}
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurer.java b/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurer.java
index aedcd4fd9..f8976bf2a 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurer.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurer.java
@@ -1,11 +1,11 @@
package com.epam.catgenome.app;
-import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
+import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
/**
* Enables configuration of Tomcat container, should be used only with embedded container
*/
public interface TomcatConfigurer {
- void configure(TomcatEmbeddedServletContainerFactory tomcat, int cacheSize,
- int tomcatCacheSize);
+ void configure(TomcatServletWebServerFactory tomcat, int cacheSize,
+ int tomcatCacheSize);
}
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurerImpl.java b/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurerImpl.java
index 72e738426..903e2d96a 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurerImpl.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/app/TomcatConfigurerImpl.java
@@ -1,7 +1,7 @@
package com.epam.catgenome.app;
import org.apache.catalina.webresources.StandardRoot;
-import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
+import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
public class TomcatConfigurerImpl implements TomcatConfigurer {
@@ -10,9 +10,9 @@ public TomcatConfigurerImpl() {
}
@Override
- public void configure(TomcatEmbeddedServletContainerFactory tomcat, int cacheSize,
- int tomcatCacheSize) {
- tomcat.addContextCustomizers((context) -> {
+ public void configure(TomcatServletWebServerFactory tomcat, int cacheSize,
+ int tomcatCacheSize) {
+ tomcat.addContextCustomizers(context -> {
StandardRoot standardRoot = new StandardRoot(context);
standardRoot.setCachingAllowed(true);
standardRoot.setCacheMaxSize(cacheSize);
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/component/MessageHelper.java b/server/catgenome/src/main/java/com/epam/catgenome/component/MessageHelper.java
index 613dac6ac..5e1e62229 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/component/MessageHelper.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/component/MessageHelper.java
@@ -137,7 +137,7 @@ public static MessageHelper singleton(final MessageSource messageSource) {
synchronized (MessageHelper.class) {
helper = instance;
if (helper == null) {
- Assert.notNull(messageSource);
+ Assert.notNull(messageSource, "");
instance = new MessageHelper(messageSource);
helper = instance;
}
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/config/SwaggerConfig.java b/server/catgenome/src/main/java/com/epam/catgenome/config/SwaggerConfig.java
deleted file mode 100644
index 6291835f6..000000000
--- a/server/catgenome/src/main/java/com/epam/catgenome/config/SwaggerConfig.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * MIT License
- *
- * Copyright (c) 2016 EPAM Systems
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package com.epam.catgenome.config;
-
-import javax.servlet.ServletContext;
-
-import com.mangofactory.swagger.configuration.SpringSwaggerConfig;
-import com.mangofactory.swagger.models.dto.ApiInfo;
-import com.mangofactory.swagger.paths.SwaggerPathProvider;
-import com.mangofactory.swagger.plugin.EnableSwagger;
-import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Source: SwaggerConfig.java
- * Created: 10/23/15, 5:05 PM
- * Project: CATGenome Browser
- * Make: IntelliJ IDEA 14.1.4, JDK 1.8
- *
- * {@code SwaggerConfig} enables and configures Swagger, used here to generate and provide
- * access to CATGenome REST API documentation through Web App.
- *
- */
-@Configuration
-@EnableSwagger
-@EnableAutoConfiguration
-@Import(SpringSwaggerConfig.class)
-public class SwaggerConfig {
-
- @Autowired
- private ServletContext servletContext;
-
- @Autowired
- private SpringSwaggerConfig springSwaggerConfig;
-
- @SuppressWarnings("unchecked")
- @Bean
- public SwaggerSpringMvcPlugin customImplementation() {
- return new SwaggerSpringMvcPlugin(this.springSwaggerConfig)
- .apiInfo(apiInfo())
- .pathProvider(new SwaggerPathProvider() {
- @Override
- protected String applicationPath() {
- return servletContext.getContextPath();
- }
-
- @Override
- protected String getDocumentationPath() {
- return "/";
- }
- })
- .includePatterns(".*").useDefaultResponseMessages(false);
- }
-
- private ApiInfo apiInfo() {
- return new ApiInfo(
- "CATGenome Browser REST API",
- "CATGenome Browser API description.",
- "API TOS",
- "Denis_Medvedev@epam.com",
- "API License",
- "API License URL"
- );
- }
-
-}
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/AbstractRESTController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/AbstractRESTController.java
index bcc1a4ef1..53432727a 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/AbstractRESTController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/AbstractRESTController.java
@@ -70,7 +70,7 @@ public abstract class AbstractRESTController {
* is described, using Swagger-compliant annotations. It allows create nice
* documentation automatically.
*/
- protected static final int HTTP_STATUS_OK = 200;
+ protected static final String HTTP_STATUS_OK = "200";
/**
* {@code String} specifies API responses description that explains meaning of different values
@@ -93,7 +93,7 @@ public abstract class AbstractRESTController {
* @throws IOException
*/
protected File transferToTempFile(final MultipartFile multipart) throws IOException {
- Assert.notNull(multipart);
+ Assert.notNull(multipart, "");
final File tmp = File.createTempFile(UUID.randomUUID().toString(), multipart.getOriginalFilename(),
fileManager.getTempDir());
multipart.transferTo(tmp);
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/ExceptionHandlerAdvice.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/ExceptionHandlerAdvice.java
index 2954ab147..155875cfc 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/ExceptionHandlerAdvice.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/ExceptionHandlerAdvice.java
@@ -24,9 +24,7 @@
package com.epam.catgenome.controller;
-import java.io.FileNotFoundException;
-import java.sql.SQLException;
-
+import com.epam.catgenome.component.MessageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -36,14 +34,15 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.BadSqlGrammarException;
-import org.springframework.security.oauth2.common.exceptions.UnauthorizedClientException;
+import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-import com.epam.catgenome.component.MessageHelper;
+import java.io.FileNotFoundException;
+import java.sql.SQLException;
/**
* Source: ExceptionHandlerAdvice.java
@@ -90,7 +89,7 @@ public final ResponseEntity> handleUncaughtException(final Throwa
} else {
message = MessageHelper.getMessage("error.sql");
}
- } else if (exception instanceof UnauthorizedClientException) {
+ } else if (exception instanceof OAuth2AuthenticationException) {
message = exception.getMessage();
code = HttpStatus.UNAUTHORIZED;
} else {
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/Result.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/Result.java
index 43798f5a1..3d02536b6 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/Result.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/Result.java
@@ -24,7 +24,7 @@
package com.epam.catgenome.controller;
-import com.wordnik.swagger.annotations.ApiModelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
import lombok.NoArgsConstructor;
/**
@@ -73,8 +73,8 @@ public String getMessage() {
return message;
}
- @ApiModelProperty(value = "it defines the status with which an operation may result in",
- allowableValues = "OK, INFO, WARN, ERROR", required = true)
+ @Schema(description = "it defines the status with which an operation may result in",
+ allowableValues = { "OK", "INFO", "WARN", "ERROR" }, required = true)
public ResultStatus getStatus() {
return status;
}
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/UtilsController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/UtilsController.java
index 2bfadd3cc..24705a3d2 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/UtilsController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/UtilsController.java
@@ -37,6 +37,9 @@
import com.epam.catgenome.manager.UrlShorterManager;
import com.epam.catgenome.util.IndexUtils;
import com.epam.catgenome.entity.UrlWithAliasItem;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
@@ -51,9 +54,6 @@
import com.epam.catgenome.manager.BiologicalDataItemManager;
import com.epam.catgenome.manager.FileManager;
import com.fasterxml.jackson.core.JsonProcessingException;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
import static com.epam.catgenome.component.MessageHelper.getMessage;
@@ -90,49 +90,45 @@ public class UtilsController extends AbstractRESTController {
@ResponseBody
@RequestMapping(value = "/version", method = RequestMethod.GET)
- @ApiOperation(
- value = "Returns application's version",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns application's version")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result loadVersion() {
return Result.success(version);
}
@ResponseBody
@RequestMapping(value = "/isRoleModelEnabled", method = RequestMethod.GET)
- @ApiOperation(
- value = "Returns application's version",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns application's version")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result isRoleModelEnabled() {
return Result.success(aclSecurityEnabled);
}
@ResponseBody
@RequestMapping(value = "/sessionExpirationBehavior", method = RequestMethod.GET)
- @ApiOperation(
- value = "Returns application's version",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns application's version")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result sessionExpirationBehaviour() {
return Result.success(expirationBehavior);
}
@ResponseBody
@RequestMapping(value = "/files", method = RequestMethod.GET)
- @ApiOperation(
- value = "Returns directory contents",
- notes = "Returns directory contents, specified by path",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns directory contents",
+ description = "Returns directory contents, specified by path")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result loadDirectoryContents(@RequestParam(required = false) String path)
throws IOException {
return Result.success(new FilesVO(fileManager.loadDirectoryContents(path), fileManager.getNgsDataRootPath()));
@@ -140,13 +136,12 @@ public Result loadDirectoryContents(@RequestParam(required = false) Str
@ResponseBody
@RequestMapping(value = "/files/allowed", method = RequestMethod.GET)
- @ApiOperation(
- value = "Checks is directory browsing is allowed",
- notes = "Returns true if directory browsing is allowed and false if not",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Checks is directory browsing is allowed",
+ description = "Returns true if directory browsing is allowed and false if not")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result isFilesBrowsingAllowed()
throws IOException {
return Result.success(fileManager.isFilesBrowsingAllowed());
@@ -154,13 +149,12 @@ public Result isFilesBrowsingAllowed()
@ResponseBody
@RequestMapping(value = "/url", method = RequestMethod.POST)
- @ApiOperation(
- value = "Generates URL postfix",
- notes = "Generates URL that displays specified files, optionally on specified interval",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Generates URL postfix",
+ description = "Generates URL that displays specified files, optionally on specified interval")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result generateUrl(
@RequestBody UrlRequestVO request,
@RequestParam(required = false) String chromosomeName,
@@ -173,13 +167,12 @@ public Result generateUrl(
@ResponseBody
@RequestMapping(value = "/urls/allowed", method = RequestMethod.GET)
- @ApiOperation(
- value = "Checks if url file browsing is allowed",
- notes = "Returns true if url file browsing is allowed and false if not",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Checks if url file browsing is allowed",
+ description = "Returns true if url file browsing is allowed and false if not")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result isUrlsBrowsingAllowed()
throws IOException {
return Result.success(fileManager.isUrlsBrowsingAllowed());
@@ -187,12 +180,11 @@ public Result isUrlsBrowsingAllowed()
@ResponseBody
@RequestMapping(value = "/generateShortUrl", method = RequestMethod.POST)
- @ApiOperation(
- value = "Generates short URL postfix",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Generates short URL postfix")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result generateShortUrl(@RequestBody UrlWithAliasItem urlWithAlias) {
String alias = urlWithAlias.getAlias();
String url = urlWithAlias.getUrl();
@@ -210,12 +202,11 @@ public Result generateShortUrl(@RequestBody UrlWithAliasItem urlWithAlia
@ResponseBody
@RequestMapping(value = "/navigate", method = RequestMethod.GET)
- @ApiOperation(
- value = "redirect on a original URL by short URL postfix, or on the 404 if short url doesn't exist",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "redirect on a original URL by short URL postfix, or on the 404 if short url doesn't exist")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public void redirectToOriginalUrlByAlias(@RequestParam String alias, HttpServletResponse resp) throws IOException {
Optional maybeOriginalUrl = urlShorterManager.getOriginalUrl(alias);
if (maybeOriginalUrl.isPresent()) {
@@ -230,22 +221,22 @@ public void redirectToOriginalUrlByAlias(@RequestParam String alias, HttpServlet
@ResponseBody
@RequestMapping(value = "/defaultTrackSettings", method = RequestMethod.GET)
- @ApiOperation(
- value = "Return default track settings",
- notes = "Return default track settings, which specified in catgenome.properties file",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Return default track settings",
+ description = "Return default track settings, which specified in catgenome.properties file")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result
* */
@Controller
-@Api(value = "externaldb", description = "External DB Management")
+@Tag(name = "externaldb", description = "External DB Management")
public class ExternalDBController extends AbstractRESTController {
private static final String SUCCESS = "info.database.successful.get";
@@ -130,15 +130,16 @@ public class ExternalDBController extends AbstractRESTController {
@ResponseBody
@RequestMapping(value = "/externaldb/uniprot/{geneId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "UniProt: Retrieves information on protein using geneId.",
- notes = "UniProt database (http://www.uniprot.org/) is being queried for information by gene " +
+ @Operation(summary = "UniProt: Retrieves information on protein using geneId.",
+ description = "UniProt database (http://www.uniprot.org/) is being queried for information by gene " +
"identifier in any database. Protein information in XML form is returned by UniProt, " +
"this information is converted to presentation required by NGGB.
" +
"Examples of id which could be used as a parameter to this service:
" +
"ENSG00000106683 -- Ensembl ID
" +
- "FBgn0000008 -- Fly Base ID
",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "FBgn0000008 -- Fly Base ID
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> fetchUniprotData(@PathVariable(value = "geneId") final String geneId)
throws ExternalDbUnavailableException {
@@ -152,15 +153,16 @@ public Result> fetchUniprotData(@PathVariable(value = "gene
@ResponseBody
@RequestMapping(value = "/externaldb/ensembl/{geneId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "Ensembl: Retrieves information on gene using geneId.",
- notes = "Ensembl database (http://rest.ensembl.org/) is being queried for information by gene " +
+ @Operation(summary = "Ensembl: Retrieves information on gene using geneId.",
+ description = "Ensembl database (http://rest.ensembl.org/) is being queried for information by gene " +
"identifier in any database. Gene information in JSON form is returned by Ensembl, " +
"this information is converted to presentation required by NGGB.
" +
"Examples of id which could be used as a parameter to this service:
" +
"ENSG00000106683 -- Ensembl ID
" +
- "FBgn0000008 -- Fly Base ID
",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "FBgn0000008 -- Fly Base ID
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchEnsemblData(@PathVariable(value = "geneId") final String geneId)
throws ExternalDbUnavailableException {
@@ -173,14 +175,15 @@ public Result fetchEnsemblData(@PathVariable(value = "geneId") f
@ResponseBody
@RequestMapping(value = "/externaldb/ensembl/variation/variationId={rsId}&species={species}",
method = RequestMethod.GET)
- @ApiOperation(value = "Ensembl: Retrieves information on variation for certain species using variation id(rsId).",
- notes = "Ensembl database (http://rest.ensembl.org/) is being queried by rsId and species " +
+ @Operation(summary = "Ensembl: Retrieves information on variation for certain species using variation id(rsId).",
+ description = "Ensembl database (http://rest.ensembl.org/) is being queried by rsId and species " +
"type. Information of variation for certain species is returned from Ensembl db.
" +
PARAMETERS_NOTE +
RSID_DESCRIPTION_NOTE + "
" +
- "species - species name: human
",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "species - species name: human
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchEnsemblVariationData(
@PathVariable(value = VARIATION_ID_NAME) final String rsId,
@PathVariable(value = "species") final String species)
@@ -194,17 +197,18 @@ public Result fetchEnsemblVariationData(
@ResponseBody
@RequestMapping(value = "/externaldb/ensembl/variation/region", method = RequestMethod.POST)
- @ApiOperation(value = "Ensembl: Retrieves information on variations located within certain chromosomal coordiates.",
- notes = "Ensembl database (http://rest.ensembl.org/) is being queried for variations located " +
+ @Operation(summary = "Ensembl: Retrieves information on variations located within certain chromosomal coordiates.",
+ description = "Ensembl database (http://rest.ensembl.org/) is being queried for variations located " +
"in between certain coordinates (start and finish) for certain chromosome " +
"for the given species.
" +
PARAMETERS_NOTE +
"species - species name (e.g. \"human\")
" +
"chromosome - chromosome name (e.g. \"1\")
" +
"start - start coordinate in a given chromosome (e.g. 140424943)
" +
- "finish - end coordinate in a given chromosome (e.g. 140624564)
",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "finish - end coordinate in a given chromosome (e.g. 140624564)
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> fetchEnsemblVariationOnRegionData(
@RequestBody final RegionQuery regionQuery)
throws ExternalDbUnavailableException {
@@ -227,8 +231,8 @@ public Result> fetchEnsemblVariationOnRegionData(
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/gene/{geneId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves gene information using gene id.",
- notes = "NCBI database (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/) " +
+ @Operation(summary = "NCBI: Retrieves gene information using gene id.",
+ description = "NCBI database (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/) " +
"is being queried by gene id.
" +
PARAMETERS_NOTE +
"geneId - NCBI gene id or Ensembl gene id (e.g. 3985, ENSG00000106683)
" +
@@ -241,9 +245,10 @@ public Result> fetchEnsemblVariationOnRegionData(
"Summary -- text description of gene
" +
"Related articles in PubMed -- pubmed db articles
" +
"Pathways from BioSystems -- biosystems reference
" +
- "Interactions -- interactions information
",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "Interactions -- interactions information
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchNCBIGene(@PathVariable(value = "geneId") final String geneId)
throws ExternalDbUnavailableException {
@@ -255,13 +260,14 @@ public Result fetchNCBIGene(@PathVariable(value = "geneId") final St
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/variation/short/{rsId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves information on short variation using rsId.",
- notes = "NCBI database (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/) is being queried by variation id" +
+ @Operation(summary = "NCBI: Retrieves information on short variation using rsId.",
+ description = "NCBI database (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/) is being queried by variation id" +
"(rsId) for short variation information.
" +
PARAMETERS_NOTE +
- RSID_DESCRIPTION_NOTE,
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ RSID_DESCRIPTION_NOTE)
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchNCBIShortVariation(@PathVariable(value = VARIATION_ID_NAME) final String rsId)
throws ExternalDbUnavailableException {
@@ -273,12 +279,13 @@ public Result fetchNCBIShortVariation(@PathVariable(value = VARI
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/variation/struct/{rsId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves information on structural variation using rsId.",
- notes = "NCBI structural variations db is being queried by rsId.
" +
+ @Operation(summary = "NCBI: Retrieves information on structural variation using rsId.",
+ description = "NCBI structural variations db is being queried by rsId.
" +
PARAMETERS_NOTE +
- RSID_DESCRIPTION_NOTE,
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ RSID_DESCRIPTION_NOTE)
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchNCBIStructVariation(@PathVariable(value = VARIATION_ID_NAME) final String rsId)
throws ExternalDbUnavailableException {
@@ -290,12 +297,13 @@ public Result fetchNCBIStructVariation(@PathVariable(value = VA
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/variation/clin/{rsId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves clinical information on variation using rsId.",
- notes = "NCBI ClinVar is being queried by rsId
" +
+ @Operation(summary = "NCBI: Retrieves clinical information on variation using rsId.",
+ description = "NCBI ClinVar is being queried by rsId
" +
PARAMETERS_NOTE +
- RSID_DESCRIPTION_NOTE,
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ RSID_DESCRIPTION_NOTE)
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchNCBIClinVariation(@PathVariable(value = VARIATION_ID_NAME) final String rsId)
throws ExternalDbUnavailableException {
@@ -308,15 +316,16 @@ public Result fetchNCBIClinVariation(@PathVariable(value = VARIAT
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/taxonomy/{taxId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves information on species from taxonomy database.",
- notes = "NCBI Taxonomy database is being queried by taxId for organism information.
" +
+ @Operation(summary = "NCBI: Retrieves information on species from taxonomy database.",
+ description = "NCBI Taxonomy database is being queried by taxId for organism information.
" +
PARAMETERS_NOTE +
"taxId - id of species in taxonomy database (e.g. 9606)
" +
RETURNS_NOTE +
"commonName - common species name (e.g. \"human\")
" +
- "scientificName - scientific species name (e.g. \"homo sapiens\")
",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "scientificName - scientific species name (e.g. \"homo sapiens\")
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchNCBITaxonomyInfo(@PathVariable(value = "taxId") final String taxId)
throws ExternalDbUnavailableException {
@@ -327,10 +336,11 @@ public Result fetchNCBITaxonomyInfo(@PathVariable(value = "taxId
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/taxonomy/{term}", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves list of organisms for search query",
- notes = "NCBI: Retrieves list of organisms for search query",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ @Operation(summary = "NCBI: Retrieves list of organisms for search query",
+ description = "NCBI: Retrieves list of organisms for search query")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> getOrganismsByTerm(@PathVariable final String term)
throws ExternalDbUnavailableException, JsonProcessingException {
return Result.success(ncbiAuxiliaryManager.fetchTaxonomyInfosByTermMock(term));
@@ -338,16 +348,18 @@ public Result> getOrganismsByTerm(@PathVariable final Strin
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/variation/{rsId}/get", method = RequestMethod.GET)
- @ApiOperation(value = "NCBI: Retrieves aggregated information on variation using rsId.",
- notes = "Several NCBI databases are being queried by rsId, result information is being aggregated" +
+ @Operation(summary = "NCBI: Retrieves aggregated information on variation using rsId.",
+ description = "Several NCBI databases are being queried by rsId, result information is being aggregated" +
"in a proper way and returned by service.
" +
PARAMETERS_NOTE +
RSID_DESCRIPTION_NOTE +
"Following sequence of queries is peroformed:
" +
"1) Short variation db poll
" +
"2) Clin variation db poll
" +
- "3) Taxonomy db poll
", produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ "3) Taxonomy db poll
")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result fetchNCBIAggregatedVariationInfo(@PathVariable(value = VARIATION_ID_NAME)
final String rsId)
throws ExternalDbUnavailableException {
@@ -362,18 +374,19 @@ public Result fetchNCBIAggregatedVariationInfo(@PathVariable(va
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/variation/region", method = RequestMethod.POST)
- @ApiOperation(
- value = "NCBI: Retrieves information on variations located in given interval",
- notes = "NCBI snp database is being queried for variations in given interval" +
+ @Operation(
+ summary = "NCBI: Retrieves information on variations located in given interval",
+ description = "NCBI snp database is being queried for variations in given interval" +
"in a proper way and returned by service.
" +
PARAMETERS_NOTE +
"species - species name (e.g. \"human\")
" +
"chromosome - chromosome name (e.g. \"1\")
" +
"start - start coordinate in a given chromosome (e.g. 140424943)
" +
"finish - end coordinate in a given chromosome (e.g. 140624564)
" +
- RSID_DESCRIPTION_NOTE,
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(value = { @ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) })
+ RSID_DESCRIPTION_NOTE)
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> fetchNCBIVariationInfoOnInterval(@RequestBody final RegionQuery regionQuery)
throws ExternalDbUnavailableException {
@@ -388,14 +401,13 @@ public Result> fetchNCBIVariationInfoOnInterval(@RequestBody fin
@ResponseBody
@RequestMapping(value = "/externaldb/blat/search", method = RequestMethod.POST)
- @ApiOperation(
- value = "Returns statistics generated by BLAT search.",
- notes = "Provides statistics generated by BLAT search performed on a read sequence. ReferenceId is required "
- + "to search for required species",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns statistics generated by BLAT search.",
+ description = "Provides statistics generated by BLAT search performed on a read sequence. ReferenceId is required "
+ + "to search for required species")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> blatReadSequence(@RequestParam
final Long referenceId,
@RequestBody final ReadSequenceVO readSequence)
@@ -405,13 +417,12 @@ public Result> blatReadSequence(@RequestParam
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/genes/import", method = RequestMethod.PUT)
- @ApiOperation(
- value = "Imports gene ids data from NCBI",
- notes = "Imports gene ids data from NCBI",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Imports gene ids data from NCBI",
+ description = "Imports gene ids data from NCBI")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result importNCBIGeneIdsData(@RequestParam final String path) throws IOException, ParseException {
ncbiEnsemblIdsManager.importData(path);
return Result.success(null);
@@ -419,13 +430,12 @@ public Result importNCBIGeneIdsData(@RequestParam final String path) th
@ResponseBody
@RequestMapping(value = "/externaldb/ncbi/genes/info/import", method = RequestMethod.PUT)
- @ApiOperation(
- value = "Imports genes info data from NCBI",
- notes = "Imports genes info data from NCBI",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Imports genes info data from NCBI",
+ description = "Imports genes info data from NCBI")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result importNCBIGenesInfoData(@RequestParam final String path) throws IOException, ParseException {
ncbiGeneInfoManager.importData(path);
return Result.success(null);
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologController.java
index 883e9f114..6a3eeeb54 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologController.java
@@ -30,10 +30,10 @@
import com.epam.catgenome.manager.externaldb.SearchResult;
import com.epam.catgenome.manager.externaldb.homolog.HomologSearchRequest;
import com.epam.catgenome.manager.externaldb.homolog.HomologSecurityService;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.lucene.queryparser.classic.ParseException;
import org.springframework.http.MediaType;
@@ -44,46 +44,43 @@
import java.util.Map;
@RestController
-@Api(value = "homolog", description = "Homolog Data Management")
+@Tag(name = "homolog", description = "Homolog Data Management")
@RequiredArgsConstructor
public class HomologController extends AbstractRESTController {
private final HomologSecurityService homologSecurityService;
@PostMapping(value = "/homolog/search")
- @ApiOperation(
- value = "Searches homologs by gene ID",
- notes = "Searches homologs by gene ID",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Searches homologs by gene ID",
+ description = "Searches homologs by gene ID")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> search(@RequestBody final HomologSearchRequest searchRequest)
throws IOException, ParseException, ExternalDbUnavailableException {
return Result.success(homologSecurityService.searchHomolog(searchRequest));
}
@GetMapping(value = "/homolog/search")
- @ApiOperation(
- value = "Searches homologs by gene IDs",
- notes = "Searches homologs by gene IDs",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Searches homologs by gene IDs",
+ description = "Searches homologs by gene IDs")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result>> search(@RequestParam final List geneIds)
throws IOException, ParseException {
return Result.success(homologSecurityService.searchHomolog(geneIds));
}
@PutMapping(value = "/homolog/import")
- @ApiOperation(
- value = "Imports Homolog data",
- notes = "Imports Homolog data",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Imports Homolog data",
+ description = "Imports Homolog data")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result importHomologData(@RequestParam final String databaseName,
@RequestParam final String databasePath)
throws IOException, ParseException {
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologeneController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologeneController.java
index a8e5ac073..570338e2a 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologeneController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/HomologeneController.java
@@ -29,10 +29,10 @@
import com.epam.catgenome.manager.externaldb.SearchResult;
import com.epam.catgenome.manager.externaldb.homologene.HomologeneSecurityService;
import com.epam.catgenome.manager.externaldb.homologene.HomologeneSearchRequest;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.lucene.queryparser.classic.ParseException;
import org.springframework.http.MediaType;
@@ -43,20 +43,19 @@
import java.util.Map;
@RestController
-@Api(value = "homologene", description = "Homologene Data Management")
+@Tag(name = "homologene", description = "Homologene Data Management")
@RequiredArgsConstructor
public class HomologeneController extends AbstractRESTController {
private final HomologeneSecurityService homologeneSecurityService;
@PostMapping(value = "/homologene/search")
- @ApiOperation(
- value = "Returns list of Homologenes",
- notes = "Returns list of Homologenes",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns list of Homologenes",
+ description = "Returns list of Homologenes")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> search(
@RequestBody final HomologeneSearchRequest query)
throws IOException, ParseException {
@@ -64,26 +63,24 @@ public Result> search(
}
@GetMapping(value = "/homologene/search")
- @ApiOperation(
- value = "Returns list of Homologenes by gene ids",
- notes = "Returns list of Homologenes by gene ids",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns list of Homologenes by gene ids",
+ description = "Returns list of Homologenes by gene ids")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result>> search(@RequestParam final List geneIds)
throws IOException, ParseException {
return Result.success(homologeneSecurityService.searchHomologenes(geneIds));
}
@PutMapping(value = "/homologene/import")
- @ApiOperation(
- value = "Creates Homologene Lucene Index from Homologene file",
- notes = "Creates Homologene Lucene Index from Homologene file",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Creates Homologene Lucene Index from Homologene file",
+ description = "Creates Homologene Lucene Index from Homologene file")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result importHomologeneDatabase(@RequestParam final String databasePath)
throws IOException, ParseException {
homologeneSecurityService.importHomologeneDatabase(databasePath);
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/TaxonomyController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/TaxonomyController.java
index fb8dddd04..ee28b2fd4 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/TaxonomyController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/externaldb/TaxonomyController.java
@@ -27,10 +27,10 @@
import com.epam.catgenome.controller.Result;
import com.epam.catgenome.manager.externaldb.taxonomy.TaxonomySecurityService;
import com.epam.catgenome.manager.externaldb.taxonomy.Taxonomy;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.lucene.queryparser.classic.ParseException;
import org.springframework.http.MediaType;
@@ -44,45 +44,42 @@
import java.util.List;
@RestController
-@Api(value = "taxonomy", description = "Taxonomy Data Management")
+@Tag(name = "taxonomy", description = "Taxonomy Data Management")
@RequiredArgsConstructor
public class TaxonomyController extends AbstractRESTController {
private final TaxonomySecurityService taxonomySecurityService;
@GetMapping(value = "/taxonomies/{term}")
- @ApiOperation(
- value = "Returns list of Organisms by term",
- notes = "Returns list of Organisms by term",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns list of Organisms by term",
+ description = "Returns list of Organisms by term")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> loadTaxonomies(@PathVariable final String term)
throws IOException, ParseException {
return Result.success(taxonomySecurityService.searchOrganisms(term));
}
@GetMapping(value = "/taxonomy/{taxId}")
- @ApiOperation(
- value = "Returns Organism by taxId",
- notes = "Returns Organism by taxId",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns Organism by taxId",
+ description = "Returns Organism by taxId")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result loadTaxonomy(@PathVariable final long taxId) throws IOException, ParseException {
return Result.success(taxonomySecurityService.searchOrganismById(taxId));
}
@PutMapping(value = "/taxonomy/upload")
- @ApiOperation(
- value = "Creates Taxonomy Lucene Index from Taxonomy file",
- notes = "Creates Taxonomy Lucene Index from Taxonomy file",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Creates Taxonomy Lucene Index from Taxonomy file",
+ description = "Creates Taxonomy Lucene Index from Taxonomy file")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result uploadTaxonomyDatabase(@RequestParam final String taxonomyFilePath)
throws IOException, ParseException {
taxonomySecurityService.writeLuceneTaxonomyIndex(taxonomyFilePath);
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/filter/FilterController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/filter/FilterController.java
index a1adf1965..ea13abaaf 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/filter/FilterController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/filter/FilterController.java
@@ -50,10 +50,10 @@
import com.epam.catgenome.entity.index.VcfIndexEntry;
import com.epam.catgenome.entity.vcf.VcfFilterForm;
import com.epam.catgenome.entity.vcf.VcfFilterInfo;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
import javax.servlet.http.HttpServletResponse;
@@ -61,7 +61,7 @@
* A REST controller implementation, responsible for VCF filter services
*/
@RestController
-@Api(value = "Filter", description = "Filtering operations")
+@Tag(name = "Filter", description = "Filtering operations")
public class FilterController extends AbstractRESTController {
@Autowired
private FeatureIndexSecurityService featureIndexSecurityService;
@@ -70,35 +70,33 @@ public class FilterController extends AbstractRESTController {
private VcfSecurityService vcfSecurityService;
@RequestMapping(value = "/filter/searchGenes", method = RequestMethod.POST)
- @ApiOperation(
- value = "Searches for IDs of genes, that are affected by variations",
- notes = "Searches for IDs of genes, that are affected by variations located in VCF files, specified by ids",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Searches for IDs of genes, that are affected by variations",
+ description = "Searches for IDs of genes, that are affected by variations located in VCF files, specified by ids")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result> searchGenesInProject(@RequestBody GeneSearchQuery geneQuery) throws IOException {
return Result.success(featureIndexSecurityService.searchGenesInVcfFiles(geneQuery.getSearch(),
geneQuery.getVcfIdsByProject()));
}
@RequestMapping(value = "/filter/info", method = RequestMethod.POST)
- @ApiOperation(
- value = "Returns information about VCF filter by file IDs.",
- notes = "Returns information about VCF filter by file IDs, all information taken from file header.",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ @Operation(
+ summary = "Returns information about VCF filter by file IDs.",
+ description = "Returns information about VCF filter by file IDs, all information taken from file header.")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result getFieldInfo(
@RequestBody ItemsByProject vcfFileIdsByProjectId) throws IOException {
return Result.success(vcfSecurityService.getFiltersInfo(vcfFileIdsByProjectId.getValue()));
}
@RequestMapping(value = "/filter", method = RequestMethod.POST)
- @ApiOperation(
- value = "Filters variations for a given VCF file",
- notes = "Request should contain the following fields:
" +
+ @Operation(
+ summary = "Filters variations for a given VCF file",
+ description = "Request should contain the following fields:
" +
"vcfFileIds: an array of IDs of VCF files to filter
" +
"other fields are optional:
" +
"chromosomeId: an ID of a chromosome to load variations" +
@@ -149,20 +147,19 @@ public Result getFieldInfo(
"okay
" +
"impact: an impact of a variation" +
"effect: an effect of a variation" +
- "info: an object, containing requested additional info fields, if they are present",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ "info: an object, containing requested additional info fields, if they are present")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Callable>> filterVcf(@RequestBody final VcfFilterForm filterForm)
throws IOException {
return () -> Result.success(featureIndexSecurityService.filterVariations(filterForm));
}
@RequestMapping(value = "/filter/export", method = RequestMethod.POST)
- @ApiOperation(
- value = "Filters variations for a given VCF file and exports to CSV/TSV",
- notes = "Request should contain the following fields:
" +
+ @Operation(
+ summary = "Filters variations for a given VCF file and exports to CSV/TSV",
+ description = "Request should contain the following fields:
" +
"vcfFileIds: an array of IDs of VCF files to filter
" +
"other fields are optional:
" +
"chromosomeId: an ID of a chromosome to load variations" +
@@ -213,9 +210,10 @@ public Callable>> filterVcf(@RequestBody
"okay
" +
"impact: an impact of a variation" +
"effect: an effect of a variation" +
- "info: an object, containing requested additional info fields, if they are present",
- produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
- @ApiResponses(value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)})
+ "info: an object, containing requested additional info fields, if they are present")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public void exportVcf(@RequestBody final VcfExportFilterForm filterForm,
@RequestParam final FileFormat format,
@RequestParam final boolean includeHeader,
@@ -226,9 +224,9 @@ public void exportVcf(@RequestBody final VcfExportFilterForm filterForm,
}
@RequestMapping(value = "/filter/group", method = RequestMethod.POST)
- @ApiOperation(
- value = "Groups variations by given field for a given set of VCF files, according to filter",
- notes = "Request should contain the following fields:
" +
+ @Operation(
+ summary = "Groups variations by given field for a given set of VCF files, according to filter",
+ description = "Request should contain the following fields:
" +
"vcfFileIds: an array of IDs of VCF files to filter
" +
"other fields are optional:
" +
"chromosomeId: an ID of a chromosome to load variations" +
@@ -273,11 +271,10 @@ public void exportVcf(@RequestBody final VcfExportFilterForm filterForm,
"okay
" +
"impact: an impact of a variation" +
"effect: an effect of a variation" +
- "info: an object, containing requested additional info fields, if they are present",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ "info: an object, containing requested additional info fields, if they are present")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Callable>> groupVariations(
@RequestBody final VcfFilterForm filterForm,
@RequestParam String groupBy) {
diff --git a/server/catgenome/src/main/java/com/epam/catgenome/controller/gene/GeneController.java b/server/catgenome/src/main/java/com/epam/catgenome/controller/gene/GeneController.java
index 5725b6945..71eaf6550 100644
--- a/server/catgenome/src/main/java/com/epam/catgenome/controller/gene/GeneController.java
+++ b/server/catgenome/src/main/java/com/epam/catgenome/controller/gene/GeneController.java
@@ -67,10 +67,10 @@
import com.epam.catgenome.exception.GeneReadingException;
import com.epam.catgenome.exception.HistogramReadingException;
import com.epam.catgenome.util.Utils;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
@@ -91,7 +91,7 @@
* @author Mikhail Miroliubov
*/
@Controller
-@Api(value = "genes", description = "Gene Track Management")
+@Tag(name = "genes", description = "Gene Track Management")
public class GeneController extends AbstractRESTController {
private static final String REFERENCE_ID_FIELD = "referenceId";
@@ -106,18 +106,17 @@ public class GeneController extends AbstractRESTController {
@ResponseBody
@RequestMapping(value = "/gene/register", method = RequestMethod.POST)
- @ApiOperation(
- value = "Registers a gene file in the system.",
- notes = "Registers a file, stored in a file system (for now). Registration request has the following " +
+ @Operation(
+ summary = "Registers a gene file in the system.",
+ description = "Registers a file, stored in a file system (for now). Registration request has the following " +
"properties:
" +
"1) " + REFERENCE_ID_FIELD + " - a reference, for which file is being registered
" +
"2) path - a path to file " +
"3) indexPath - optional a path to an index file
" +
- "4) name - optional a name for gene track",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ "4) name - optional a name for gene track")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result registerGeneFile(@RequestBody
FeatureIndexedFileRegistrationRequest request) {
return Result.success(geneSecurityService.registerGeneFile(request));
@@ -125,8 +124,11 @@ public Result registerGeneFile(@RequestBody
@ResponseBody
@RequestMapping(value = "/secure/gene/register", method = RequestMethod.DELETE)
- @ApiOperation(value = "Unregisters a gene file in the system.",
- notes = "", produces = MediaType.APPLICATION_JSON_VALUE)
+ @Operation(summary = "Unregisters a gene file in the system.",
+ description = "")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result unregisterGeneFile(@RequestParam final long geneFileId) throws IOException {
GeneFile deletedFile = geneSecurityService.unregisterGeneFile(geneFileId);
return Result.success(true, MessageHelper.getMessage(MessagesConstants.INFO_UNREGISTER, deletedFile.getName()));
@@ -134,11 +136,10 @@ public Result unregisterGeneFile(@RequestParam final long geneFileId) t
@ResponseBody
@RequestMapping(value = "/gene/{geneFileId}/index", method = RequestMethod.GET)
- @ApiOperation(value = "Rebuilds a gene file feature index",
- notes = "Rebuilds a gene file feature index." +
+ @Operation(summary = "Rebuilds a gene file feature index",
+ description = "Rebuilds a gene file feature index." +
"full parameter specifies if full original file should be reindexed, or " +
- "preprocessed large scale and transcript files should be used for indexing.",
- produces = MediaType.APPLICATION_JSON_VALUE)
+ "preprocessed large scale and transcript files should be used for indexing.")
public Result reindexGeneFile(@PathVariable long geneFileId,
@RequestParam(defaultValue = "false") boolean full,
@RequestParam(defaultValue = "false") boolean createTabixIndex) throws IOException {
@@ -149,9 +150,9 @@ public Result reindexGeneFile(@PathVariable long geneFileId,
@ResponseBody
@RequestMapping(value = GENE_URL + REFERENCE_ID_FIELD + "}/track/get", method = RequestMethod.POST)
- @ApiOperation(
- value = "Returns data matched the given query to fill in a gene track.",
- notes = "It provides data for a gene track with the given scale factor between the beginning " +
+ @Operation(
+ summary = "Returns data matched the given query to fill in a gene track.",
+ description = "It provides data for a gene track with the given scale factor between the beginning " +
"position with the first base having position 1 and ending position inclusive in a target " +
"chromosome. All parameters are mandatory and described below:
" +
"1) id specifies ID of a track;
" +
@@ -160,11 +161,10 @@ public Result reindexGeneFile(@PathVariable long geneFileId,
"chromosome always has got position = 1;
" +
"4) endIndex is the last base position for a requested window.
" +
"5) scaleFactor specifies an inverse value to number of bases per one visible element on a" +
- " track (e.g., pixel) - IS IGNORED FOR NOW",
- produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiResponses(
- value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
- })
+ " track (e.g., pixel) - IS IGNORED FOR NOW")
+ @ApiResponse(responseCode = HTTP_STATUS_OK,
+ description = API_STATUS_DESCRIPTION,
+ content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
public Result