diff options
author | Bruno Sakoto <bruno.sakoto@bell.ca> | 2020-10-02 00:08:27 -0400 |
---|---|---|
committer | Bruno Sakoto <bruno.sakoto@bell.ca> | 2020-10-02 00:08:27 -0400 |
commit | f244c9cff733fe756177f3d33f7624977b660f5f (patch) | |
tree | 8fe2a5d56d7156694ab54f46098a61456a0eafee | |
parent | 5654561386856a7816a7f4e00cef746bc2facedc (diff) |
Revert "Introduce swagger configuration"
This reverts commit 0cc57ba05cc474007c91589242bfe7fc8afa9946.
3 files changed, 0 insertions, 68 deletions
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 @@ <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger2</artifactId>
- <version>2.9.2</version>
- </dependency>
-
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger-ui</artifactId>
- <version>2.9.2</version>
- </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
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<String> 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. * |