mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
In case if basePath equals to / we should not append it to url, behaviour was changed to fit this requirements (#4942)
This commit is contained in:
parent
a710149cdd
commit
722b96bcec
@ -75,12 +75,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
StringBuilder hostBuilder = new StringBuilder();
|
StringBuilder hostBuilder = new StringBuilder();
|
||||||
hostBuilder.append(getScheme());
|
hostBuilder.append(getScheme());
|
||||||
hostBuilder.append("://");
|
hostBuilder.append("://");
|
||||||
if (swagger.getHost() != null) {
|
if (!StringUtils.isEmpty(swagger.getHost())) {
|
||||||
hostBuilder.append(swagger.getHost());
|
hostBuilder.append(swagger.getHost());
|
||||||
} else {
|
} else {
|
||||||
hostBuilder.append("localhost");
|
hostBuilder.append("localhost");
|
||||||
}
|
}
|
||||||
if (swagger.getBasePath() != null) {
|
if (!StringUtils.isEmpty(swagger.getBasePath()) && !swagger.getBasePath().equals("/")) {
|
||||||
hostBuilder.append(swagger.getBasePath());
|
hostBuilder.append(swagger.getBasePath());
|
||||||
}
|
}
|
||||||
return hostBuilder.toString();
|
return hostBuilder.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user