From: Bruno Sakoto Date: Fri, 2 Oct 2020 04:08:27 +0000 (-0400) Subject: Revert "Introduce swagger configuration" X-Git-Tag: 0.0.1~120^2~19 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=f244c9cff733fe756177f3d33f7624977b660f5f;p=cps.git Revert "Introduce swagger configuration" This reverts commit 0cc57ba05cc474007c91589242bfe7fc8afa9946. --- diff --git a/cps/cps-rest/pom.xml b/cps/cps-rest/pom.xml index 253c29c517..bd9be8dfde 100644 --- a/cps/cps-rest/pom.xml +++ b/cps/cps-rest/pom.xml @@ -44,22 +44,6 @@ spring-boot-starter-jetty - - org.springframework.boot - spring-boot-starter-web - - - - io.springfox - springfox-swagger2 - 2.9.2 - - - - io.springfox - springfox-swagger-ui - 2.9.2 - org.springframework.boot diff --git a/cps/cps-rest/src/main/java/org/onap/cps/rest/config/SpringFoxConfig.java b/cps/cps-rest/src/main/java/org/onap/cps/rest/config/SpringFoxConfig.java deleted file mode 100644 index 3a9e539472..0000000000 --- a/cps/cps-rest/src/main/java/org/onap/cps/rest/config/SpringFoxConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.onap.cps.rest.config; - - -import static springfox.documentation.builders.PathSelectors.regex; - -import com.google.common.base.Predicate; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -/** - * Swagger configuration. - */ -@Configuration -@EnableSwagger2 -public class SpringFoxConfig { - - /** - * Define api configuration. - */ - @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.any()) - .paths(paths()) - .build(); - } - - private Predicate paths() { - return regex("/model.*"); - } - -} - diff --git a/cps/cps-rest/src/main/java/org/onap/cps/rest/controller/RestController.java b/cps/cps-rest/src/main/java/org/onap/cps/rest/controller/RestController.java index 9b7c0008e7..a64cd6a045 100644 --- a/cps/cps-rest/src/main/java/org/onap/cps/rest/controller/RestController.java +++ b/cps/cps-rest/src/main/java/org/onap/cps/rest/controller/RestController.java @@ -23,7 +23,6 @@ import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import java.io.File; import java.io.IOException; -import java.util.UUID; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -36,15 +35,9 @@ import org.onap.cps.api.CpService; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.parser.api.YangParserException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.multipart.MultipartFile; @Path("cps") -@org.springframework.web.bind.annotation.RestController public class RestController { @Autowired @@ -73,13 +66,6 @@ public class RestController { } } - @PostMapping("/model") - @ResponseStatus(HttpStatus.CREATED) - public String addModel(@RequestParam("file") MultipartFile file) { - // Store and return a model dto ... - return UUID.randomUUID() + " : " + file.getOriginalFilename(); - } - /** * Upload a JSON file. *