Skip to content

Commit

Permalink
GH-5 NotFoundException: null
Browse files Browse the repository at this point in the history
adding direct path. issue fixed
  • Loading branch information
lex-em committed Mar 22, 2019
1 parent e39f3e4 commit 3ee9677
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class ServiceInfo {

private String directSwaggerBaseUrl;

private String directSwaggerPath;

private String protocol = "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public Optional<String> getServiceUrl(String route) {
}

public Optional<String> getServicePath(String route) {
Optional<String> directPath = getDirectSwaggerBaseUrl(route)
.flatMap(x -> getDirectSwaggerPath(route));
if (directPath.isPresent()) {
return directPath;
}
return Optional.ofNullable(routes.get(route))
.map(ServiceInfo::getPath)
.map(path -> path.replaceAll("^/", "").replaceAll("/\\*\\*", ""));
Expand All @@ -61,4 +66,9 @@ public Optional<String> getDirectSwaggerBaseUrl(String route) {
return Optional.ofNullable(routes.get(route))
.map(ServiceInfo::getDirectSwaggerBaseUrl);
}

public Optional<String> getDirectSwaggerPath(String route) {
return Optional.ofNullable(routes.get(route))
.map(ServiceInfo::getDirectSwaggerPath);
}
}

0 comments on commit 3ee9677

Please sign in to comment.