diff --git a/src/main/java/com/epam/ta/reportportal/core/configs/SpringDocConfiguration.java b/src/main/java/com/epam/ta/reportportal/core/configs/SpringDocConfiguration.java index 949cdc0a8f..c4dce9b7f7 100644 --- a/src/main/java/com/epam/ta/reportportal/core/configs/SpringDocConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/core/configs/SpringDocConfiguration.java @@ -63,6 +63,7 @@ import java.util.Set; import java.util.stream.Collectors; import javax.servlet.ServletContext; +import org.apache.commons.lang3.StringUtils; import org.springdoc.core.SpringDocUtils; import org.springdoc.core.customizers.OpenApiCustomiser; import org.springdoc.core.customizers.OperationCustomizer; @@ -133,7 +134,7 @@ public OpenAPI openAPI() { .bearerFormat("JWT") ) ) - .addServersItem(new Server().url(pathValue)); + .addServersItem(new Server().url(getPathValue())); } /** @@ -288,4 +289,8 @@ private void setParameters(Operation operation, Collection parameters operation.addParametersItem(parameter); } } + + private String getPathValue() { + return StringUtils.isEmpty(pathValue) || pathValue.equals("/") ? "/api" : pathValue; + } }