diff --git a/pom.xml b/pom.xml
index 6dc2a107c..709862cbe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
bio.overture
song
pom
- 4.4.0
+ 4.5.0
song-core
song-java-sdk
diff --git a/song-client/pom.xml b/song-client/pom.xml
index 98a86d462..f90f4c1ee 100644
--- a/song-client/pom.xml
+++ b/song-client/pom.xml
@@ -18,7 +18,7 @@
song
bio.overture
- 4.4.0
+ 4.5.0
4.0.0
@@ -35,12 +35,12 @@
bio.overture
song-java-sdk
- 4.4.0
+ 4.5.0
bio.overture
song-core
- 4.4.0
+ 4.5.0
diff --git a/song-core/pom.xml b/song-core/pom.xml
index be0c2ebf6..a14700b9e 100644
--- a/song-core/pom.xml
+++ b/song-core/pom.xml
@@ -19,7 +19,7 @@
song
bio.overture
- 4.4.0
+ 4.5.0
4.0.0
diff --git a/song-java-sdk/pom.xml b/song-java-sdk/pom.xml
index b04bc0902..0eab6b6be 100644
--- a/song-java-sdk/pom.xml
+++ b/song-java-sdk/pom.xml
@@ -18,7 +18,7 @@
song
bio.overture
- 4.4.0
+ 4.5.0
4.0.0
diff --git a/song-server/pom.xml b/song-server/pom.xml
index af41598e8..0a5474a81 100644
--- a/song-server/pom.xml
+++ b/song-server/pom.xml
@@ -19,7 +19,7 @@
song
bio.overture
- 4.4.0
+ 4.5.0
4.0.0
@@ -37,7 +37,7 @@
bio.overture
song-core
- 4.4.0
+ 4.5.0
diff --git a/song-server/src/main/java/bio/overture/song/server/config/SwaggerConfig.java b/song-server/src/main/java/bio/overture/song/server/config/SwaggerConfig.java
index 60dd1ded9..f41d284b4 100644
--- a/song-server/src/main/java/bio/overture/song/server/config/SwaggerConfig.java
+++ b/song-server/src/main/java/bio/overture/song/server/config/SwaggerConfig.java
@@ -27,6 +27,7 @@
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.paths.RelativePathProvider;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger.web.UiConfiguration;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@@ -42,15 +43,30 @@ public class SwaggerConfig {
@Getter
private String alternateSwaggerUrl;
+ // default is empty
+ @Value("${swagger.host:}")
+ private String swaggerHost;
+
+ // default is empty
+ @Value("${swagger.basePath:}")
+ private String basePath;
+
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(basePackage("bio.overture.song.server.controller"))
- .paths(any())
.build()
- .pathMapping("/");
+ .host(swaggerHost)
+ .pathProvider(
+ new RelativePathProvider(null) {
+ @Override
+ public String getApplicationBasePath() {
+ return basePath;
+ }
+ }
+ );
}
@Bean
diff --git a/song-server/src/main/resources/application.yml b/song-server/src/main/resources/application.yml
index c8c4fd82b..1b079eb60 100644
--- a/song-server/src/main/resources/application.yml
+++ b/song-server/src/main/resources/application.yml
@@ -80,6 +80,11 @@ management:
swagger:
alternateUrl: "/api-docs"
+ # host and base url are needed if you run song behind a reverse proxy
+ # and rewrite the url eg: http://mydomain.com/song/swagger-ui.html
+ # in this case host = mydomain.com, baseUrl = /song
+ host: ""
+ basePath: ""
security.basic.enabled: false