Skip to content
Open
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
8 changes: 6 additions & 2 deletions src/main/java/swurg/workers/Worker.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public List<String> parseMetadata(OpenAPI openAPI) {
return metadataList;
}

public static String fixUriPath(String rawPath) {
return rawPath.replaceFirst("^/+", "");
}

public List<MyHttpRequest> parseOpenAPI(OpenAPI openAPI) {
List<MyHttpRequest> logEntries = new ArrayList<>();

Expand All @@ -85,7 +89,7 @@ public List<MyHttpRequest> parseOpenAPI(OpenAPI openAPI) {
.ifPresent(op -> {
try {
URI serverUri = new URI(serverUrl);
URI baseUrl = new URIBuilder(serverUri).setPath(serverUri.getPath() + path)
URI baseUrl = new URIBuilder(serverUri).setPath(serverUri.getPath() + fixUriPath(path))
.build();

HttpService httpService = HttpService.httpService(baseUrl.toString());
Expand Down Expand Up @@ -195,4 +199,4 @@ else if ("query".equals(in))

return httpParameters;
}
}
}