diff --git a/src/main/java/ru/reliabletech/zuul/swagger/props/ServiceInfo.java b/src/main/java/ru/reliabletech/zuul/swagger/props/ServiceInfo.java index b95d488..067e578 100644 --- a/src/main/java/ru/reliabletech/zuul/swagger/props/ServiceInfo.java +++ b/src/main/java/ru/reliabletech/zuul/swagger/props/ServiceInfo.java @@ -21,6 +21,8 @@ class ServiceInfo { private String directSwaggerBaseUrl; + private String directSwaggerPath; + private String protocol = ""; } \ No newline at end of file diff --git a/src/main/java/ru/reliabletech/zuul/swagger/props/ServicesSwaggerInfo.java b/src/main/java/ru/reliabletech/zuul/swagger/props/ServicesSwaggerInfo.java index ffd23cc..b10baf7 100644 --- a/src/main/java/ru/reliabletech/zuul/swagger/props/ServicesSwaggerInfo.java +++ b/src/main/java/ru/reliabletech/zuul/swagger/props/ServicesSwaggerInfo.java @@ -52,6 +52,11 @@ public Optional getServiceUrl(String route) { } public Optional getServicePath(String route) { + Optional 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("/\\*\\*", "")); @@ -61,4 +66,9 @@ public Optional getDirectSwaggerBaseUrl(String route) { return Optional.ofNullable(routes.get(route)) .map(ServiceInfo::getDirectSwaggerBaseUrl); } + + public Optional getDirectSwaggerPath(String route) { + return Optional.ofNullable(routes.get(route)) + .map(ServiceInfo::getDirectSwaggerPath); + } } \ No newline at end of file