removed swagger

This commit is contained in:
Fabio Sinibaldi 2020-10-13 15:01:12 +02:00
parent d3380737ec
commit eeb6b242a9
7 changed files with 37 additions and 48 deletions

12
pom.xml
View File

@ -105,7 +105,7 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
@ -151,11 +151,11 @@
<!-- swagger -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.5.0</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>io.swagger</groupId> -->
<!-- <artifactId>swagger-jersey2-jaxrs</artifactId> -->
<!-- <version>1.5.0</version> -->
<!-- </dependency> -->
<!-- GN EXTERNAL -->

View File

@ -8,11 +8,9 @@ import org.gcube.smartgears.ContextProvider;
import org.gcube.smartgears.configuration.container.ContainerConfiguration;
import org.gcube.smartgears.context.application.ApplicationContext;
import org.gcube.spatial.data.sdi.model.ServiceConstants;
import org.gcube.spatial.data.sdi.rest.GeoNetwork;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.server.ResourceConfig;
import io.swagger.jaxrs.config.BeanConfig;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@ApplicationPath(ServiceConstants.APPLICATION)
@ -27,8 +25,8 @@ public class SDIService extends ResourceConfig{
super();
packages("org.gcube.spatial.data");
// packages("org.gcube.spatial.data.sdi.model");
register(io.swagger.jaxrs.listing.ApiListingResource.class);
register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
// register(io.swagger.jaxrs.listing.ApiListingResource.class);
// register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
register(MultiPartFeature.class);
// register(MoxyXmlFeature.class);
ApplicationContext context=ContextProvider.get();
@ -55,17 +53,17 @@ public class SDIService extends ResourceConfig{
//SWAGGER
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion("1.0.0");
beanConfig.setSchemes(new String[]{"http","https"});
beanConfig.setHost(hostName+":"+port);
beanConfig.setBasePath("/gcube/service/");
beanConfig.setResourcePackage(GeoNetwork.class.getPackage().getName());
beanConfig.setTitle("SDI Service");
beanConfig.setDescription("REST Interface towards SDI facilities");
beanConfig.setPrettyPrint(true);
beanConfig.setScan(true);
// BeanConfig beanConfig = new BeanConfig();
// beanConfig.setVersion("1.0.0");
// beanConfig.setSchemes(new String[]{"http","https"});
// beanConfig.setHost(hostName+":"+port);
// beanConfig.setBasePath("/gcube/service/");
// beanConfig.setResourcePackage(GeoNetwork.class.getPackage().getName());
// beanConfig.setTitle("SDI Service");
// beanConfig.setDescription("REST Interface towards SDI facilities");
// beanConfig.setPrettyPrint(true);
// beanConfig.setScan(true);
//
// System.out.println("********************** SDI INIT *****************************");

View File

@ -25,11 +25,9 @@ import org.gcube.spatial.data.sdi.model.services.ServiceDefinition.Type;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@Path(ServiceConstants.GeoNetwork.INTERFACE)
@Api(value=ServiceConstants.GeoNetwork.INTERFACE)
@Slf4j
@ManagedBy(SDIServiceManager.class)
public class GeoNetwork {

View File

@ -24,11 +24,9 @@ import org.gcube.spatial.data.sdi.model.services.ServiceDefinition.Type;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@Path(ServiceConstants.GeoServer.INTERFACE)
@Api(value=ServiceConstants.GeoServer.INTERFACE)
@Slf4j
@ManagedBy(SDIServiceManager.class)
public class GeoServer {

View File

@ -17,11 +17,10 @@ import org.gcube.spatial.data.sdi.model.health.HealthReport;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@Path(ServiceConstants.INTERFACE)
@Api(value=ServiceConstants.INTERFACE)
//@Api(value=ServiceConstants.INTERFACE)
@ManagedBy(SDIServiceManager.class)
@Slf4j
public class SDI {

View File

@ -15,11 +15,10 @@ import org.gcube.spatial.data.sdi.SDIServiceManager;
import org.gcube.spatial.data.sdi.engine.ThreddsManager;
import org.gcube.spatial.data.sdi.utils.ScopeUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@Path("Thredds")
@Api(value="Thredds")
//@Api(value="Thredds")
@Slf4j
@ManagedBy(SDIServiceManager.class)
public class Thredds {

View File

@ -12,14 +12,13 @@ import org.gcube.spatial.data.sdi.LocalConfiguration;
import org.gcube.spatial.data.sdi.SDIService;
import org.gcube.spatial.data.sdi.engine.GISManager;
import org.gcube.spatial.data.sdi.engine.GeoNetworkManager;
import org.gcube.spatial.data.sdi.engine.TemplateManager;
import org.gcube.spatial.data.sdi.engine.RoleManager;
import org.gcube.spatial.data.sdi.engine.SDIManager;
import org.gcube.spatial.data.sdi.engine.TemplateManager;
import org.gcube.spatial.data.sdi.engine.TemporaryPersistence;
import org.gcube.spatial.data.sdi.engine.ThreddsManager;
import org.gcube.spatial.data.sdi.model.ServiceConstants;
import org.gcube.spatial.data.sdi.model.metadata.TemplateDescriptor;
import org.gcube.spatial.data.sdi.rest.GeoNetwork;
import org.gcube.spatial.data.sdi.test.factories.GISManagerFactory;
import org.gcube.spatial.data.sdi.test.factories.GeoNetworkManagerFactory;
import org.gcube.spatial.data.sdi.test.factories.MetadataTemplateManagerFactory;
@ -34,8 +33,6 @@ import org.glassfish.jersey.test.JerseyTest;
import org.junit.BeforeClass;
import org.junit.Test;
import io.swagger.jaxrs.config.BeanConfig;
public class MainTest extends JerseyTest{
@BeforeClass
@ -69,22 +66,22 @@ public class MainTest extends JerseyTest{
ResourceConfig config= new ResourceConfig(SDIService.class);
config.register(new MyBinder());
config.register(io.swagger.jaxrs.listing.ApiListingResource.class);
config.register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
// config.register(io.swagger.jaxrs.listing.ApiListingResource.class);
// config.register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
//
// //SWAGGER
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion("1.0.0");
beanConfig.setSchemes(new String[]{"http","https"});
beanConfig.setHost("localhost:9998");
beanConfig.setBasePath("gcube/service");
String packageName=GeoNetwork.class.getPackage().getName();
System.out.println("PACKAGE : "+packageName);
beanConfig.setResourcePackage(packageName);
beanConfig.setScan(true);
System.out.println(beanConfig.getSwagger());
// BeanConfig beanConfig = new BeanConfig();
// beanConfig.setVersion("1.0.0");
// beanConfig.setSchemes(new String[]{"http","https"});
// beanConfig.setHost("localhost:9998");
// beanConfig.setBasePath("gcube/service");
// String packageName=GeoNetwork.class.getPackage().getName();
// System.out.println("PACKAGE : "+packageName);
// beanConfig.setResourcePackage(packageName);
// beanConfig.setScan(true);
// System.out.println(beanConfig.getSwagger());
//
//
//Multipart
// config.packages("org.glassfish.jersey.media.multipart");