[#1832] Fix root redirect to swagger ui (#2355)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-04-15 09:13:50 +03:00
committed by GitHub
parent e48d6b3a96
commit 9290ea194c
4 changed files with 6 additions and 14 deletions

3
.gitignore vendored
View File

@@ -58,6 +58,9 @@ classpath-data.json
# local Spring configs
application-local.properties
application-local.yaml
application-local-*.properties
application-local-*.yaml
# Maven
maven.properties

View File

@@ -13,7 +13,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.RedirectView;
/**
@@ -36,10 +35,7 @@ public class DDIStart {
public static class RedirectController {
@GetMapping("/")
public RedirectView redirectToSwagger(
RedirectAttributes attributes) {
attributes.addFlashAttribute("flashAttribute", "redirectWithRedirectView");
attributes.addAttribute("attribute", "redirectWithRedirectView");
public RedirectView redirectToSwagger() {
return new RedirectView("swagger-ui/index.html");
}
}

View File

@@ -13,7 +13,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.RedirectView;
/**
@@ -36,10 +35,7 @@ public class MgmtServerStart {
public static class RedirectController {
@GetMapping("/")
public RedirectView redirectToSwagger(
RedirectAttributes attributes) {
attributes.addFlashAttribute("flashAttribute", "redirectWithRedirectView");
attributes.addAttribute("attribute", "redirectWithRedirectView");
public RedirectView redirectToSwagger() {
return new RedirectView("swagger-ui/index.html");
}
}

View File

@@ -13,7 +13,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.RedirectView;
/**
@@ -40,9 +39,7 @@ public class Start {
public static class RedirectController {
@GetMapping("/")
public RedirectView redirectToSwagger(final RedirectAttributes attributes) {
attributes.addFlashAttribute("flashAttribute", "redirectWithRedirectView");
attributes.addAttribute("attribute", "redirectWithRedirectView");
public RedirectView redirectToSwagger() {
return new RedirectView("swagger-ui/index.html");
}
}