Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-93009 || Some requests don't work in Swagger - 405 error, while they work in Postman and via UI #2024

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -133,7 +134,7 @@ public OpenAPI openAPI() {
.bearerFormat("JWT")
)
)
.addServersItem(new Server().url(pathValue));
.addServersItem(new Server().url(getPathValue()));
}

/**
Expand Down Expand Up @@ -288,4 +289,8 @@ private void setParameters(Operation operation, Collection<Parameter> parameters
operation.addParametersItem(parameter);
}
}

private String getPathValue() {
return StringUtils.isEmpty(pathValue) || pathValue.equals("/") ? "/api" : pathValue;
}
}
Loading