Fixed improper handling of base path

This commit is contained in:
Tony West committed 2026-01-15 10:54:22 -05:00
1 parent a77f9f46bb
commit 8e2e5fbebc
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ $ sj convert -u https://petstore.swagger.io/v2/swagger.json -o openapi.json`,
log.Error("Command not specified. See the --help flag for usage.")
}
},
Version: "2.0.3",
Version: "2.0.4",
}
func Execute() {
+2
View File
@@ -96,6 +96,8 @@ func GenerateRequests(bodyBytes []byte, client http.Client) {
if serverURL, ok := srv["url"].(string); ok {
if strings.Contains(serverURL, "://") {
apiTarget = serverURL
} else if serverURL == "/" {
basePath = ""
} else {
basePath = serverURL
apiTarget = u.Scheme + "://" + u.Host