Skip to content

Commit d2fbf70

Browse files
committed
fixed base path exception on URL parsing
1 parent 4618668 commit d2fbf70

File tree

1 file changed

+2
-0
lines changed
  • modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/utils

1 file changed

+2
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/utils/URLPathUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public static URL getServerURL(OpenAPI openAPI) {
2626
String url = server.getUrl();
2727
if(url.equals(DEFAULT_PATH)) {
2828
url = LOCAL_HOST;
29+
} else if (url.startsWith("/") && url.trim().length() > 1) {
30+
url = LOCAL_HOST + url;
2931
}
3032
try {
3133
return new URL(url);

0 commit comments

Comments
 (0)