From 44179d218732fb9ff01bf5eba88bea5253b6ef54 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Wed, 28 Jun 2023 10:13:24 +0530 Subject: [PATCH] Java 21460 Move code from spring-boot-swagger & spring-boot-swagger-2 to spring-boot-swagger-springfox module (#14310) * JAVA-21460 Upgrade spring-boot-swagger-jwt modules to use SpringDoc in place of SpringFox * JAVA-21460 Upgrade spring-boot-swagger-2 module to use SpringDoc in place of SpringFox * JAVA-21460 Upgrade spring-boot-swagger module to use SpringDoc in place of SpringFox * JAVA-21460 Move code from spring-boot-swagger & spring-boot-swagger-2 to spring-boot-swagger-springfox module * JAVA-21457 Upgrade spring-security-web-rest to use SpringDoc in place of SpringFox --- .../spring-boot-swagger-2/README.md | 1 - .../spring-boot-swagger-2/pom.xml | 10 ----- .../spring-boot-swagger-springfox/README.md | 7 ++++ .../spring-boot-swagger-springfox/pom.xml | 39 +++++++++++++++++++ .../com/baeldung/apiswagger/Application.java | 0 .../config/SwaggerConfiguration.java | 0 .../apiswagger/controller/BookController.java | 0 .../demo/SpringFoxExampleApplication.java | 0 .../demo/config/SpringFoxSwaggerConfig.java | 0 .../demo/controller/SwaggerController.java | 13 +++++++ .../demo/controller/TopicsController.java | 26 +++++++++++++ .../baeldung/springdoc/demo/model/Topic.java | 26 +++++++++++++ .../springdoc/demo/service/TopicService.java | 26 +++++++++++++ .../com/baeldung/swagger2/SwaggerConfig.java | 0 .../SpringBootSwaggerApplication.java | 0 .../configuration/SwaggerConfiguration.java | 0 .../controller/RegularRestController.java | 0 .../SpringBootSwaggerConfApplication.java | 0 .../configuration/SwaggerConfiguration.java | 0 .../ErrorControllerExcludedForAnnotation.java | 0 .../ErrorControllerExcludedForApiIgnore.java | 0 .../ErrorControllerExcludedForPath.java | 0 .../controller/RegularRestController.java | 0 .../ErrorControllerExcludedForPackage.java | 0 .../web/controller/CustomController.java | 0 .../src/main/resources/application.properties | 1 + ...ExcludeErrorControllerIntegrationTest.java | 0 .../com/baeldung/web/SwaggerLiveTest.java | 4 +- .../spring-boot-swagger/README.md | 3 -- .../spring-boot-swagger/pom.xml | 6 --- .../spring-security-web-rest/README.md | 1 - .../spring-security-web-rest/pom.xml | 13 ------- 32 files changed, 140 insertions(+), 36 deletions(-) create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/README.md create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/pom.xml rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/apiswagger/Application.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/apiswagger/config/SwaggerConfiguration.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/apiswagger/controller/BookController.java (100%) rename spring-boot-modules/{spring-boot-swagger-2 => spring-boot-swagger-springfox}/src/main/java/com/baeldung/springdoc/demo/SpringFoxExampleApplication.java (100%) rename spring-boot-modules/{spring-boot-swagger-2 => spring-boot-swagger-springfox}/src/main/java/com/baeldung/springdoc/demo/config/SpringFoxSwaggerConfig.java (100%) create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/SwaggerController.java create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/TopicsController.java create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/model/Topic.java create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/service/TopicService.java rename {spring-security-modules/spring-security-web-rest => spring-boot-modules/spring-boot-swagger-springfox}/src/main/java/com/baeldung/swagger2/SwaggerConfig.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/SpringBootSwaggerConfApplication.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/configuration/SwaggerConfiguration.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForAnnotation.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForApiIgnore.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForPath.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/controller/RegularRestController.java (100%) rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/main/java/com/baeldung/swaggerconf/excluded/ErrorControllerExcludedForPackage.java (100%) rename {spring-security-modules/spring-security-web-rest => spring-boot-modules/spring-boot-swagger-springfox}/src/main/java/com/baeldung/web/controller/CustomController.java (100%) create mode 100644 spring-boot-modules/spring-boot-swagger-springfox/src/main/resources/application.properties rename spring-boot-modules/{spring-boot-swagger => spring-boot-swagger-springfox}/src/test/java/com/baeldung/swaggerconf/SwaggerConfExcludeErrorControllerIntegrationTest.java (100%) rename {spring-security-modules/spring-security-web-rest => spring-boot-modules/spring-boot-swagger-springfox}/src/test/java/com/baeldung/web/SwaggerLiveTest.java (83%) diff --git a/spring-boot-modules/spring-boot-swagger-2/README.md b/spring-boot-modules/spring-boot-swagger-2/README.md index 99e4c4cca5..1b43b09e39 100644 --- a/spring-boot-modules/spring-boot-swagger-2/README.md +++ b/spring-boot-modules/spring-boot-swagger-2/README.md @@ -5,4 +5,3 @@ - [Swagger @ApiParam vs @ApiModelProperty](https://www.baeldung.com/swagger-apiparam-vs-apimodelproperty) - [Map Date Types With OpenAPI Generator](https://www.baeldung.com/openapi-map-date-types) - [API First Development with Spring Boot and OpenAPI 3.0](https://www.baeldung.com/spring-boot-openapi-api-first-development) -- [Change Swagger-UI URL prefix](https://www.baeldung.com/spring-boot-custom-swagger-url) diff --git a/spring-boot-modules/spring-boot-swagger-2/pom.xml b/spring-boot-modules/spring-boot-swagger-2/pom.xml index daca41426a..12b9bf664b 100644 --- a/spring-boot-modules/spring-boot-swagger-2/pom.xml +++ b/spring-boot-modules/spring-boot-swagger-2/pom.xml @@ -34,11 +34,6 @@ springfox-oas ${springfox.version} - - io.springfox - springfox-swagger-ui - ${springfox.version} - javax.validation validation-api @@ -48,11 +43,6 @@ springfox-swagger2 ${springfox.version} - - io.springfox - springfox-spring-webmvc - ${springfox.version} - diff --git a/spring-boot-modules/spring-boot-swagger-springfox/README.md b/spring-boot-modules/spring-boot-swagger-springfox/README.md new file mode 100644 index 0000000000..301b2752ee --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/README.md @@ -0,0 +1,7 @@ +## Relevant Articles: + +- [Hiding Endpoints From Swagger Documentation in Spring Boot](https://www.baeldung.com/spring-swagger-hiding-endpoints) +- [Swagger @Api Description Is Deprecated](https://www.baeldung.com/java-swagger-api-description-deprecated) +- [Remove Basic Error Controller In SpringFox Swagger-UI](https://www.baeldung.com/spring-swagger-remove-error-controller) +- [Change Swagger-UI URL prefix](https://www.baeldung.com/spring-boot-custom-swagger-url) +- [Setting Up Swagger 2 with a Spring REST API Using Springfox](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger-springfox/pom.xml b/spring-boot-modules/spring-boot-swagger-springfox/pom.xml new file mode 100644 index 0000000000..8efe03bc72 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + spring-boot-swagger-springfox + 0.1.0-SNAPSHOT + spring-boot-swagger-springfox + jar + Module For Spring Boot Swagger Springfox + + + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + + + + + org.springframework.boot + spring-boot-starter-web + + + io.springfox + springfox-boot-starter + ${springfox.version} + + + com.google.guava + guava + ${guava.version} + + + + + 3.0.0 + + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/apiswagger/Application.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/apiswagger/Application.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/apiswagger/Application.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/apiswagger/Application.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/apiswagger/config/SwaggerConfiguration.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/apiswagger/config/SwaggerConfiguration.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/apiswagger/config/SwaggerConfiguration.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/apiswagger/config/SwaggerConfiguration.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/apiswagger/controller/BookController.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/apiswagger/controller/BookController.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/apiswagger/controller/BookController.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/apiswagger/controller/BookController.java diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/springdoc/demo/SpringFoxExampleApplication.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/SpringFoxExampleApplication.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/springdoc/demo/SpringFoxExampleApplication.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/SpringFoxExampleApplication.java diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/springdoc/demo/config/SpringFoxSwaggerConfig.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/config/SpringFoxSwaggerConfig.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/springdoc/demo/config/SpringFoxSwaggerConfig.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/config/SpringFoxSwaggerConfig.java diff --git a/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/SwaggerController.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/SwaggerController.java new file mode 100644 index 0000000000..79c35e025e --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/SwaggerController.java @@ -0,0 +1,13 @@ +package com.baeldung.springdoc.demo.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class SwaggerController { + + @RequestMapping("/myproject") + public String getRedirectUrl() { + return "redirect:swagger-ui.html"; + } +} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/TopicsController.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/TopicsController.java new file mode 100644 index 0000000000..dee825788d --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/controller/TopicsController.java @@ -0,0 +1,26 @@ +package com.baeldung.springdoc.demo.controller; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.springdoc.demo.model.Topic; +import com.baeldung.springdoc.demo.service.TopicService; + + +@RestController +public class TopicsController { + + @Autowired + TopicService topicService; + + @GetMapping(value = "/topics") + public ResponseEntity> getAllTopics() { + return new ResponseEntity<>(topicService.getAlllTopics(), HttpStatus.OK); + } +} diff --git a/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/model/Topic.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/model/Topic.java new file mode 100644 index 0000000000..0e4417b64f --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/model/Topic.java @@ -0,0 +1,26 @@ +package com.baeldung.springdoc.demo.model; + +public class Topic { + + Integer id; + String name; + + public Topic(Integer id, String name) { + super(); + this.id = id; + this.name = name; + } + + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } +} diff --git a/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/service/TopicService.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/service/TopicService.java new file mode 100644 index 0000000000..a468d2915b --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/springdoc/demo/service/TopicService.java @@ -0,0 +1,26 @@ +package com.baeldung.springdoc.demo.service; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.stereotype.Service; + +import com.baeldung.springdoc.demo.model.Topic; + +@Service +public class TopicService { + + private List topicsList; + + public TopicService(){ + this.topicsList = new ArrayList() {{ + add(new Topic(1, "Topic1")); + add(new Topic(2, "Topic2")); + add(new Topic(3, "Topic3")); + }}; + } + + public List getAlllTopics(){ + return topicsList; + } +} diff --git a/spring-security-modules/spring-security-web-rest/src/main/java/com/baeldung/swagger2/SwaggerConfig.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2/SwaggerConfig.java similarity index 100% rename from spring-security-modules/spring-security-web-rest/src/main/java/com/baeldung/swagger2/SwaggerConfig.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2/SwaggerConfig.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/SpringBootSwaggerConfApplication.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/SpringBootSwaggerConfApplication.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/SpringBootSwaggerConfApplication.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/SpringBootSwaggerConfApplication.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/configuration/SwaggerConfiguration.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/configuration/SwaggerConfiguration.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/configuration/SwaggerConfiguration.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/configuration/SwaggerConfiguration.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForAnnotation.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForAnnotation.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForAnnotation.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForAnnotation.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForApiIgnore.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForApiIgnore.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForApiIgnore.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForApiIgnore.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForPath.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForPath.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForPath.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/ErrorControllerExcludedForPath.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/RegularRestController.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/RegularRestController.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/controller/RegularRestController.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/controller/RegularRestController.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/excluded/ErrorControllerExcludedForPackage.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/excluded/ErrorControllerExcludedForPackage.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerconf/excluded/ErrorControllerExcludedForPackage.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/swaggerconf/excluded/ErrorControllerExcludedForPackage.java diff --git a/spring-security-modules/spring-security-web-rest/src/main/java/com/baeldung/web/controller/CustomController.java b/spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/web/controller/CustomController.java similarity index 100% rename from spring-security-modules/spring-security-web-rest/src/main/java/com/baeldung/web/controller/CustomController.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/main/java/com/baeldung/web/controller/CustomController.java diff --git a/spring-boot-modules/spring-boot-swagger-springfox/src/main/resources/application.properties b/spring-boot-modules/spring-boot-swagger-springfox/src/main/resources/application.properties new file mode 100644 index 0000000000..a4e98652bc --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-springfox/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger/src/test/java/com/baeldung/swaggerconf/SwaggerConfExcludeErrorControllerIntegrationTest.java b/spring-boot-modules/spring-boot-swagger-springfox/src/test/java/com/baeldung/swaggerconf/SwaggerConfExcludeErrorControllerIntegrationTest.java similarity index 100% rename from spring-boot-modules/spring-boot-swagger/src/test/java/com/baeldung/swaggerconf/SwaggerConfExcludeErrorControllerIntegrationTest.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/test/java/com/baeldung/swaggerconf/SwaggerConfExcludeErrorControllerIntegrationTest.java diff --git a/spring-security-modules/spring-security-web-rest/src/test/java/com/baeldung/web/SwaggerLiveTest.java b/spring-boot-modules/spring-boot-swagger-springfox/src/test/java/com/baeldung/web/SwaggerLiveTest.java similarity index 83% rename from spring-security-modules/spring-security-web-rest/src/test/java/com/baeldung/web/SwaggerLiveTest.java rename to spring-boot-modules/spring-boot-swagger-springfox/src/test/java/com/baeldung/web/SwaggerLiveTest.java index 3f86b63503..4dec4acaa5 100644 --- a/spring-security-modules/spring-security-web-rest/src/test/java/com/baeldung/web/SwaggerLiveTest.java +++ b/spring-boot-modules/spring-boot-swagger-springfox/src/test/java/com/baeldung/web/SwaggerLiveTest.java @@ -4,8 +4,8 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; -import com.jayway.restassured.RestAssured; -import com.jayway.restassured.response.Response; +import io.restassured.RestAssured; +import io.restassured.response.Response; public class SwaggerLiveTest { private static final String URL_PREFIX = "http://localhost:8080/spring-security-rest/api"; diff --git a/spring-boot-modules/spring-boot-swagger/README.md b/spring-boot-modules/spring-boot-swagger/README.md index c3f6578dee..ecf057bda1 100644 --- a/spring-boot-modules/spring-boot-swagger/README.md +++ b/spring-boot-modules/spring-boot-swagger/README.md @@ -1,9 +1,6 @@ ## Relevant Articles: -- [Hiding Endpoints From Swagger Documentation in Spring Boot](https://www.baeldung.com/spring-swagger-hiding-endpoints) -- [Swagger @Api Description Is Deprecated](https://www.baeldung.com/java-swagger-api-description-deprecated) - [Generate PDF from Swagger API Documentation](https://www.baeldung.com/swagger-generate-pdf) -- [Remove Basic Error Controller In SpringFox Swagger-UI](https://www.baeldung.com/spring-swagger-remove-error-controller) - [Setting Example and Description with Swagger](https://www.baeldung.com/swagger-set-example-description) - [Document Enum in Swagger](https://www.baeldung.com/swagger-enum) - [@ApiOperation vs @ApiResponse in Swagger](https://www.baeldung.com/swagger-apioperation-vs-apiresponse) diff --git a/spring-boot-modules/spring-boot-swagger/pom.xml b/spring-boot-modules/spring-boot-swagger/pom.xml index c064f9c636..668c9d561f 100644 --- a/spring-boot-modules/spring-boot-swagger/pom.xml +++ b/spring-boot-modules/spring-boot-swagger/pom.xml @@ -20,11 +20,6 @@ org.springframework.boot spring-boot-starter-web - - io.springfox - springfox-boot-starter - ${springfox.version} - com.github.kongchen swagger-maven-plugin @@ -85,7 +80,6 @@ - 3.0.0 3.1.1 1.7.0 diff --git a/spring-security-modules/spring-security-web-rest/README.md b/spring-security-modules/spring-security-web-rest/README.md index 5a94504762..a11bc7e8d6 100644 --- a/spring-security-modules/spring-security-web-rest/README.md +++ b/spring-security-modules/spring-security-web-rest/README.md @@ -9,7 +9,6 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: -- [Setting Up Swagger 2 with a Spring REST API Using Springfox](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) - [Custom Error Message Handling for REST API](https://www.baeldung.com/global-error-handler-in-a-spring-rest-api) - [Spring Security Context Propagation with @Async](https://www.baeldung.com/spring-security-async-principal-propagation) - [Servlet 3 Async Support with Spring MVC and Spring Security](https://www.baeldung.com/spring-mvc-async-security) diff --git a/spring-security-modules/spring-security-web-rest/pom.xml b/spring-security-modules/spring-security-web-rest/pom.xml index 99a040293b..76d9ad37de 100644 --- a/spring-security-modules/spring-security-web-rest/pom.xml +++ b/spring-security-modules/spring-security-web-rest/pom.xml @@ -139,17 +139,6 @@ - - - io.springfox - springfox-swagger2 - ${springfox-swagger.version} - - - io.springfox - springfox-swagger-ui - ${springfox-swagger.version} - commons-fileupload commons-fileupload @@ -246,8 +235,6 @@ 1.1.0.Final 2.9.0 - - 3.0.0 1.6.1