summaryrefslogtreecommitdiffstats
path: root/pomba/network-discovery/src/main/java
diff options
context:
space:
mode:
authorNorm Traxler <normant@amdocs.com>2019-01-15 00:59:28 +0000
committerNorm Traxler <normant@amdocs.com>2019-01-15 01:01:14 +0000
commitdcd5545d38527e498905eafd244d0de0940905da (patch)
treea37dbeb4fd68cab27e5e9b2809df92bc42707991 /pomba/network-discovery/src/main/java
parent20c6155c781f2bec7920d37da40c23f3e2a26b89 (diff)
Network Discovery Swagger fix
Issue-ID: LOG-927 Change-Id: Ice25909e2aa0dc2bc566b585c1d3e4a577c3a73c Signed-off-by: Norm Traxler <normant@amdocs.com>
Diffstat (limited to 'pomba/network-discovery/src/main/java')
-rw-r--r--pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/Application.java8
-rw-r--r--pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/JerseyConfiguration.java18
2 files changed, 11 insertions, 15 deletions
diff --git a/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/Application.java b/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/Application.java
index c9b995f..5a643b0 100644
--- a/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/Application.java
+++ b/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/Application.java
@@ -19,19 +19,11 @@
package org.onap.sdnc.apps.pomba.networkdiscovery;
import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication
-@ComponentScan(basePackages = {"org.onap.sdnc.apps.pomba.networkdiscovery"})
-@EnableAsync
-@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
diff --git a/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/JerseyConfiguration.java b/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/JerseyConfiguration.java
index e073e34..5dcddbb 100644
--- a/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/JerseyConfiguration.java
+++ b/pomba/network-discovery/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/JerseyConfiguration.java
@@ -31,6 +31,7 @@ import org.glassfish.jersey.servlet.ServletProperties;
import org.onap.sdnc.apps.pomba.networkdiscovery.service.rs.RestService;
import org.onap.sdnc.apps.pomba.networkdiscovery.service.rs.RestServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@@ -39,13 +40,16 @@ import io.swagger.jaxrs.listing.ApiListingResource;
import io.swagger.jaxrs.listing.SwaggerSerializers;
@Component
-@ApplicationPath("/")
+@ApplicationPath("/network-discovery")
public class JerseyConfiguration extends ResourceConfig {
-
+
public static final String SERVICE_NAME = "network-discovery";
+ @Value("${spring.jersey.application-path:/network-discovery}")
+ private String apiPath;
+
private static final Logger log = Logger.getLogger(JerseyConfiguration.class.getName());
-
+
@Autowired
public JerseyConfiguration() {
register(RestServiceImpl.class);
@@ -61,7 +65,7 @@ public class JerseyConfiguration extends ResourceConfig {
@PostConstruct
public void init() {
// Register components where DI is needed
- this.configureSwagger();
+ configureSwagger();
}
private void configureSwagger() {
@@ -70,10 +74,10 @@ public class JerseyConfiguration extends ResourceConfig {
this.register(SwaggerSerializers.class);
BeanConfig config = new BeanConfig();
- config.setTitle("Network Discovery Swagger");
+ config.setTitle("Network Discovery API");
config.setVersion("v1");
- config.setSchemes(new String[] { "https", "http" });
- config.setBasePath("/" + SERVICE_NAME);
+ config.setSchemes(new String[] { "https", "http" });
+ config.setBasePath(apiPath);
config.setResourcePackage(RestService.class.getPackage().getName());
config.setPrettyPrint(true);
config.setScan(true);