This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-356-refactor-rest-api
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/UNOMI-356-refactor-rest-api by 
this push:
     new 8443fbb  Add customizer to make the try out URL work.
8443fbb is described below

commit 8443fbbba8e80e4db4721739235db77c21228f68
Author: Serge Huber <[email protected]>
AuthorDate: Fri Jun 26 17:29:56 2020 +0200

    Add customizer to make the try out URL work.
---
 rest/src/main/java/org/apache/unomi/rest/RestServer.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rest/src/main/java/org/apache/unomi/rest/RestServer.java 
b/rest/src/main/java/org/apache/unomi/rest/RestServer.java
index 48fae61..1e6f358 100644
--- a/rest/src/main/java/org/apache/unomi/rest/RestServer.java
+++ b/rest/src/main/java/org/apache/unomi/rest/RestServer.java
@@ -22,6 +22,7 @@ import org.apache.cxf.BusFactory;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.feature.LoggingFeature;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.openapi.OpenApiCustomizer;
 import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
 import org.apache.cxf.jaxrs.security.JAASAuthenticationFilter;
 import org.osgi.framework.BundleContext;
@@ -144,6 +145,9 @@ public class RestServer {
         
openApiFeature.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html";);
         openApiFeature.setScan(false);
         openApiFeature.setUseContextBasedConfig(true);        //Set<String> 
resourceClasses = serviceBeans.stream().map(service -> 
service.getClass().getName()).collect(toSet());
+        OpenApiCustomizer customizer = new OpenApiCustomizer();
+        customizer.setDynamicBasePath(true);
+        openApiFeature.setCustomizer(customizer);
 
         JAXRSServerFactoryBean jaxrsServerFactoryBean = new 
JAXRSServerFactoryBean();
         jaxrsServerFactoryBean.setAddress("/");

Reply via email to