mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +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();
|
||||
hostBuilder.append(getScheme());
|
||||
hostBuilder.append("://");
|
||||
if (swagger.getHost() != null) {
|
||||
if (!StringUtils.isEmpty(swagger.getHost())) {
|
||||
hostBuilder.append(swagger.getHost());
|
||||
} else {
|
||||
hostBuilder.append("localhost");
|
||||
}
|
||||
if (swagger.getBasePath() != null) {
|
||||
if (!StringUtils.isEmpty(swagger.getBasePath()) && !swagger.getBasePath().equals("/")) {
|
||||
hostBuilder.append(swagger.getBasePath());
|
||||
}
|
||||
return hostBuilder.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user