From bd929355529650912d3e72c2dc6f6b9d25bbd364 Mon Sep 17 00:00:00 2001 From: Tjark Wilhelm Hoeck <tjark.hoeck@mni.thm.de> Date: Thu, 4 Jun 2015 18:20:56 +0200 Subject: [PATCH] ignore needless to show controllers in swagger ui --- .../de/thm/arsnova/controller/ConfigurationController.java | 3 +++ .../java/de/thm/arsnova/controller/FeedbackController.java | 3 +++ src/main/java/de/thm/arsnova/controller/LegacyController.java | 3 +++ src/main/java/de/thm/arsnova/controller/LoginController.java | 3 +++ .../arsnova/controller/SecurityExceptionControllerAdvice.java | 3 +++ src/main/java/de/thm/arsnova/controller/UserController.java | 3 +++ src/main/java/de/thm/arsnova/controller/WelcomeController.java | 3 +++ 7 files changed, 21 insertions(+) diff --git a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java index 99b5d3cb..e8cd8d6d 100644 --- a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java +++ b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java @@ -21,6 +21,8 @@ import java.util.HashMap; import javax.servlet.http.HttpServletRequest; +import springfox.documentation.annotations.ApiIgnore; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -35,6 +37,7 @@ import org.springframework.web.bind.annotation.ResponseBody; * in case the backend application is deployed as root context. */ @Controller +@ApiIgnore @RequestMapping({"/configuration", "/arsnova-config"}) public class ConfigurationController extends AbstractController { @Value("${security.guest.enabled}") diff --git a/src/main/java/de/thm/arsnova/controller/FeedbackController.java b/src/main/java/de/thm/arsnova/controller/FeedbackController.java index cee5de52..6680602a 100644 --- a/src/main/java/de/thm/arsnova/controller/FeedbackController.java +++ b/src/main/java/de/thm/arsnova/controller/FeedbackController.java @@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + import de.thm.arsnova.entities.Feedback; import de.thm.arsnova.entities.User; import de.thm.arsnova.exceptions.NotFoundException; @@ -42,6 +44,7 @@ import de.thm.arsnova.web.DeprecatedApi; * @see de.thm.arsnova.socket.ARSnovaSocketIOServer */ @RestController +@ApiIgnore public class FeedbackController extends AbstractController { public static final Logger LOGGER = LoggerFactory.getLogger(FeedbackController.class); diff --git a/src/main/java/de/thm/arsnova/controller/LegacyController.java b/src/main/java/de/thm/arsnova/controller/LegacyController.java index c15295d0..7ed3cdbf 100644 --- a/src/main/java/de/thm/arsnova/controller/LegacyController.java +++ b/src/main/java/de/thm/arsnova/controller/LegacyController.java @@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; +import springfox.documentation.annotations.ApiIgnore; + import de.thm.arsnova.services.IQuestionService; import de.thm.arsnova.web.DeprecatedApi; @@ -33,6 +35,7 @@ import de.thm.arsnova.web.DeprecatedApi; * This controller forwards requests from deprecated URLs to their new controller, where the requests are handled. */ @Controller +@ApiIgnore public class LegacyController extends AbstractController { public static final Logger LOGGER = LoggerFactory.getLogger(LegacyController.class); diff --git a/src/main/java/de/thm/arsnova/controller/LoginController.java b/src/main/java/de/thm/arsnova/controller/LoginController.java index 3b6d9680..c947220a 100644 --- a/src/main/java/de/thm/arsnova/controller/LoginController.java +++ b/src/main/java/de/thm/arsnova/controller/LoginController.java @@ -57,6 +57,8 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.View; import org.springframework.web.servlet.view.RedirectView; +import springfox.documentation.annotations.ApiIgnore; + import de.thm.arsnova.entities.ServiceDescription; import de.thm.arsnova.entities.Session; import de.thm.arsnova.entities.User; @@ -68,6 +70,7 @@ import de.thm.arsnova.services.UserSessionService; * Handles authentication specific requests. */ @Controller +@ApiIgnore public class LoginController extends AbstractController { private static final int MAX_USERNAME_LENGTH = 15; diff --git a/src/main/java/de/thm/arsnova/controller/SecurityExceptionControllerAdvice.java b/src/main/java/de/thm/arsnova/controller/SecurityExceptionControllerAdvice.java index d1a472a2..12bf9daf 100644 --- a/src/main/java/de/thm/arsnova/controller/SecurityExceptionControllerAdvice.java +++ b/src/main/java/de/thm/arsnova/controller/SecurityExceptionControllerAdvice.java @@ -30,6 +30,8 @@ import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; +import springfox.documentation.annotations.ApiIgnore; + import de.thm.arsnova.exceptions.BadRequestException; import de.thm.arsnova.exceptions.ForbiddenException; import de.thm.arsnova.exceptions.NoContentException; @@ -43,6 +45,7 @@ import de.thm.arsnova.exceptions.PayloadTooLargeException; * Translates security/authentication related exceptions into HTTP status codes. */ @ControllerAdvice +@ApiIgnore public class SecurityExceptionControllerAdvice { @ResponseStatus(HttpStatus.NOT_FOUND) diff --git a/src/main/java/de/thm/arsnova/controller/UserController.java b/src/main/java/de/thm/arsnova/controller/UserController.java index a113f184..07638a6b 100644 --- a/src/main/java/de/thm/arsnova/controller/UserController.java +++ b/src/main/java/de/thm/arsnova/controller/UserController.java @@ -31,6 +31,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; +import springfox.documentation.annotations.ApiIgnore; + import de.thm.arsnova.entities.DbUser; import de.thm.arsnova.services.IUserService; import de.thm.arsnova.services.UserSessionService; @@ -39,6 +41,7 @@ import de.thm.arsnova.services.UserSessionService; * Handles requests related to ARSnova's own user registration and login process. */ @Controller +@ApiIgnore @RequestMapping("/user") public class UserController extends AbstractController { @Value("${security.guest.enabled}") diff --git a/src/main/java/de/thm/arsnova/controller/WelcomeController.java b/src/main/java/de/thm/arsnova/controller/WelcomeController.java index 095d6205..900dfe2f 100644 --- a/src/main/java/de/thm/arsnova/controller/WelcomeController.java +++ b/src/main/java/de/thm/arsnova/controller/WelcomeController.java @@ -40,6 +40,8 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.View; import org.springframework.web.servlet.view.RedirectView; +import springfox.documentation.annotations.ApiIgnore; + import de.thm.arsnova.exceptions.BadRequestException; import de.thm.arsnova.exceptions.NoContentException; @@ -47,6 +49,7 @@ import de.thm.arsnova.exceptions.NoContentException; * Default controller that handles requests which have not set a path. */ @Controller +@ApiIgnore public class WelcomeController extends AbstractController { @Value("${mobile.path}") -- GitLab